Types
API
- isHoliday(date, region)
- getHolidayByDate(date, region)
- getHolidays(year, region)
- isSunOrHoliday(date, region)
- isSpecificHoliday(date, name, region)
- addTranslation(isoCode, translation)
- setLanguage(lng)
- getLanguage()
Type: ("NEUJAHRSTAG"
| "HEILIGEDREIKOENIGE"
| "KARFREITAG"
| "OSTERSONNTAG"
| "OSTERMONTAG"
| "TAG_DER_ARBEIT"
| "CHRISTIHIMMELFAHRT"
| "MARIAHIMMELFAHRT"
| "PFINGSTSONNTAG"
| "PFINGSTMONTAG"
| "FRONLEICHNAM"
| "DEUTSCHEEINHEIT"
| "REFORMATIONSTAG"
| "ALLERHEILIGEN"
| "BUBETAG"
| "ERSTERWEIHNACHTSFEIERTAG"
| "ZWEITERWEIHNACHTSFEIERTAG"
| "WELTKINDERTAG"
| "WELTFRAUENTAG"
| "AUGSBURGER_FRIEDENSFEST"
)
Type: ("BW"
| "BY"
| "BE"
| "BB"
| "HB"
| "HE"
| "HH"
| "MV"
| "NI"
| "NW"
| "RP"
| "SL"
| "SN"
| "ST"
| "SH"
| "TH"
| "BUND"
| "ALL"
)
As defined here: https://de.wikipedia.org/wiki/Land_(Deutschland)#Amtliche_bzw._Eigenbezeichnungen
The difference between BUND and ALL is defined as follows:
- "ALL" refers to every holiday which is valid in at least one region. So a holiday that only applies to one state will be included.
- "BUND" refers to holidays that are valid in every region ("bundesweit"). So a holiday that only applies to one state will not be included.
Type: {name: HolidayType, date: Date, trans: function (lang: string?): string, dateString: string, equals: function (date: Date): boolean}
Properties
name
HolidayTypedate
Datetrans
function (lang: string?): stringdateString
stringequals
function (date: Date): boolean
Type: Array<HolidayType>
Map of HolidayType to translation string.
Type: {}
Adds a translation for the holidays (e.g. English). This also allows overriding the German names. Hint: Interpolates German for missing translations
Parameters
isoCode
string of the new languagenewTranslation
TranslationTable map of {HolidayType} to translation stringg
Set a language to default language
Parameters
isoCode
string
Get currently set language
Returns string
Checks if a specific date is sunday or holiday.
Parameters
Returns boolean
Check is specific date is holiday.
Parameters
Returns boolean
Parameters
Returns (Holiday | void)
Parameters
date
DateholidayName
HolidayTyperegion
Region (optional, default'ALL'
)
Returns boolean
Returns all holidays of a year in a Region.
Parameters