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