npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

feiertage

v1.2.0

Published

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

Downloads

13

Readme

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.

| Code | Description | | ----- | -------------------------------------------------------------------------------------- | | DE | Deutschland (all known non-business days) | | BW | Baden-Württemberg | | BY | Bayern | | BE | Berlin | | BB | Brandenburg | | HB | Bremen | | HH | Hamburg | | HE | Hessen | | NI | Niedersachsen | | MV | Mecklenburg-Vorpommern | | NW | Nordrhein-Westfalen | | RP | Rheinland-Pfalz | | SL | Saarland | | SN | Sachsen | | ST | Sachsen-Anhalt | | SH | Schleswig-Holstein | | TH | Thüringen | | BY-FF | Bayern, Friedensfest, Augsburg only | | BY-MH | Bayern, Mariä Himmelfahrt, predominantly catholic population | | SN-FL | Sachsen, Fronleichnam, some communities in Bautzen | | TH-FL | Thü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