Skip to content

Latest commit

 

History

History
129 lines (78 loc) · 5.34 KB

docs.md

File metadata and controls

129 lines (78 loc) · 5.34 KB

Table of Contents

HolidayType

Type: ("NEUJAHRSTAG" | "HEILIGEDREIKOENIGE" | "KARFREITAG" | "OSTERSONNTAG" | "OSTERMONTAG" | "TAG_DER_ARBEIT" | "CHRISTIHIMMELFAHRT" | "MARIAHIMMELFAHRT" | "PFINGSTSONNTAG" | "PFINGSTMONTAG" | "FRONLEICHNAM" | "DEUTSCHEEINHEIT" | "REFORMATIONSTAG" | "ALLERHEILIGEN" | "BUBETAG" | "ERSTERWEIHNACHTSFEIERTAG" | "ZWEITERWEIHNACHTSFEIERTAG")

Region

Type: ("BW" | "BY" | "BE" | "BB" | "HB" | "HE" | "HH" | "MV" | "NI" | "NW" | "RP" | "SL" | "SN" | "ST" | "SH" | "TH" | "BUND" | "ALL")

Holiday

Type: {name: HolidayType, date: Date, trans: function (lang: string?): string, dateString: string, equals: function (date: Date): boolean}

Properties

allHolidays

Type: Array<HolidayType>

allRegions

Type: Array<Region>

TranslationTable

Map of HolidayType to translation string.

Type: {}

addTranslation

adds a translation for the holidays (e.g. english). This also allows to override the German names. Hint: Interpolates German for missing translations

Parameters

  • isoCode string of the new language
  • newTranslation TranslationTable map of {HolidayType} to translation stringg

setLanguage

Set a language to default language

Parameters

getLanguage

Get currently set language

Returns string

isSunOrHoliday

Checks if a specific date is sunday or holiday.

Parameters

Returns boolean

isHoliday

Check is specific date is holiday.

Parameters

Returns boolean

getHolidayByDate

Parameters

  • date Date
  • region Region (optional, default 'ALL')

Returns (Holiday | void)

isSpecificHoliday

Parameters

Returns boolean

getHolidays

Returns all holidays of a year in a Region.

Parameters

Returns Array<Holiday>