The purpose of this project is to give an interface to work with holidays using date-fns
npm i us-holidays-helper
- getBankHolidays
- getChristmas
- getEaster
- getFathersDay
- getFederalHolidays
- getGoodFriday
- getHalloween
- getHolidays
- getIndependenceDay
- getIndigenousPeoplesDay
- getJuneteenth
- getLaborDay
- getMartinLutherKingJrDay
- getMemorialDay
- getMothersDay
- getNewYearsDay
- getNewYearsEve
- getObservedHolidays
- getPresidentsDay
- getThanksgiving
- getValentinesDay
- getVeteransDay
- isBankHoliday
- isDateAHoliday
- isFederalHoliday
- isHoliday
- isInHolidayList
Ƭ Holiday: "christmas"
| "easter"
| "halloween"
| "valentinesDay"
| "mothersDay"
| "indigenousPeoplesDay"
| "independenceDay"
| "presidentsDay"
| "laborDay"
| "veteransDay"
| "thanksgiving"
| "newYearsEve"
| "martinLutherKingJrDay"
| "newYearsDay"
| "fathersDay"
| "memorialDay"
| "goodFriday"
| "juneteenth"
Ƭ Holidays: { [K in Holiday]: Object }
▸ getBankHolidays(year
): Object
Name | Type |
---|---|
year |
number |
Object
▸ getChristmas(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getEaster(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getFathersDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getFederalHolidays(year
): Object
Name | Type |
---|---|
year |
number |
Object
▸ getGoodFriday(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getHalloween(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getHolidays(year
): Holidays
Name | Type |
---|---|
year |
number |
▸ getIndependenceDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getIndigenousPeoplesDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getJuneteenth(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getLaborDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getMartinLutherKingJrDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getMemorialDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getMothersDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getNewYearsDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getNewYearsEve(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getObservedHolidays(year
): Record
<string
, Record
<"date"
, Date
>>
Name | Type |
---|---|
year |
number |
Record
<string
, Record
<"date"
, Date
>>
▸ getPresidentsDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getThanksgiving(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getValentinesDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ getVeteransDay(year
): Date
Name | Type |
---|---|
year |
number |
Date
▸ isBankHoliday(date
): boolean
Name | Type |
---|---|
date |
Date |
boolean
▸ isDateAHoliday(date
, holidaysToInclude
): boolean
Name | Type |
---|---|
date |
Date |
holidaysToInclude |
Holiday [] |
boolean
▸ isFederalHoliday(date
): boolean
Name | Type |
---|---|
date |
Date |
boolean
▸ isHoliday(date
): boolean
Name | Type |
---|---|
date |
Date |
boolean
▸ isInHolidayList(date
, getHolidayList
): boolean
Name | Type |
---|---|
date |
Date |
getHolidayList |
(year : number ) => { [key: string] : { date : Date }; } |
boolean