1.2.0 • Published 6 years ago

feiertage v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

feiertage

Tiny, simple and pure module to calculate the german non-business days.

NPM

How To Use

Simply download the package or install it from npm with npm install feiertage.

var feiertage = require('feiertage');

// full list of all functions to retrieve the date for a specific non-business day of the current year
feiertage.Neujahr();
feiertage.HeiligeDreiKoenige();
feiertage.Karfreitag();
feiertage.Ostersonntag();
feiertage.Ostermontag();
feiertage.TagDerArbeit();
feiertage.ChristiHimmelfahrt();
feiertage.Pfingstsonntag();
feiertage.Pfingstmontag();
feiertage.Fronleichnam();
feiertage.MariaHimmelfahrt();
feiertage.TagDerDeutschenEinheit();
feiertage.Reformationstag();
feiertage.Allerheiligen();
feiertage.BußUndBettag();
feiertage.Heiligabend();
feiertage.ErsterWeihnachtsfeiertag();
feiertage.ZweiterWeihnachtsfeiertag();
feiertage.Silvester();

// every function accepts a year as a parameter
feiertage.Neujahr(2019);
feiertage.HeiligeDreiKoenige(2020);
...

// non-business days for the current year as a list of objects
// every objects has the properties id, label, date
feiertage.asList();

// non-business days for a given year as a list of objects
feiertage.asList(2020);
feiertage.asList(2021);

// asList also accepts a german state code, like BY, BE, SH or TH, so it returns only non-business days valid for these german states
feiertage.asList(2020, 'BY');
feiertage.asList(2021, 'BE');

// returns only non-business days falling on monday to friday
feiertage.asListOfWorkdays(2016, 'BY');

A list of the supported german state codes. There are five additional codes to specify special regulations for Friedensfest, Mariä Himmelfahrt and Fronleichnam. The code DE summarizes all german non-business days.

CodeDescription
DEDeutschland (all known non-business days)
BWBaden-Württemberg
BYBayern
BEBerlin
BBBrandenburg
HBBremen
HHHamburg
HEHessen
NINiedersachsen
MVMecklenburg-Vorpommern
NWNordrhein-Westfalen
RPRheinland-Pfalz
SLSaarland
SNSachsen
STSachsen-Anhalt
SHSchleswig-Holstein
THThüringen
BY-FFBayern, Friedensfest, Augsburg only
BY-MHBayern, Mariä Himmelfahrt, predominantly catholic population
SN-FLSachsen, Fronleichnam, some communities in Bautzen
TH-FLThüringen, Fronleichnam, some communities in Eichsfeld, Unstrut-Hainich, Wartburgkreis

Changelog

1.2.0

  • Added special state codes for BY-FF, BY-MH, SN-FL and TH-FL covering the special rules for non-business days, that are only valid in some communities, like Friedensfest, Mariä-Himmelfahrt and Fronleichnam.

1.1.2

  • The calculation of easter sunday is now based on the corrected Gauss formula by Lichtenberg

1.1.1

  • asListofWorkdays() (new) returns only those non-business days, that fall on monday to friday

1.1.0

  • setYear() was removed from the API
  • asList() now accepts a state code as second parameter, e.g. BY, BE, SH or TH
  • asList() now returns a list of objects instead of an object
1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago