The purpose of this project is to give an interface to work with holidays using date-fns
yarn add date-fns-holiday-us date-fns
or with npm:
npm i date-fns-holiday-us date-fns
- getBankHolidays
- getChristmas
- getColumbusDay
- getEaster
- getFathersDay
- getFederalHolidays
- getGoodFriday
- getHalloween
- getHolidays
- getIndependenceDay
- getJuneteenth
- getLaborDay
- getMartinLutherKingJrDay
- getMemorialDay
- getMothersDay
- getNewYearsDay
- getNewYearsEve
- getObservedHolidays
- getPresidentsDay
- getThanksgiving
- getValentinesDay
- getVeteransDay
- isBankHoliday
- isFederalHoliday
- isHoliday
- isInHolidayList
Ƭ Holiday: "christmas"
| "easter"
| "halloween"
| "valentinesDay"
| "mothersDay"
| "columbusDay"
| "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
▸ getColumbusDay(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
▸ 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
▸ 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
© 2020 Jon Stuebe