Socket
Socket
Sign inDemoInstall

holiday-de

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    holiday-de

German Holidays


Version published
Weekly downloads
2.2K
increased by9.42%
Maintainers
1
Install size
294 kB
Created
Weekly downloads
 

Readme

Source

Build Status Coverage Status

holiday-de

Determine whether a given date is a German holiday

Usage

var holiday = require('holiday-de');

// set the state (Bundesland)
holiday.setState('nw');

// check your dates -> returns true
holiday.isHoliday(new Date(2015, 0, 1));

Footnote: holiday-de plays nice with moment.

List of supported states (Bundesländer)

  • bw: Baden-Württemberg
  • by: Bayern
  • be: Berlin
  • bb: Brandenburg
  • hb: Bremen
  • hh: Hamburg
  • he: Hessen
  • mv: Mecklenburg-Vorpommern
  • ni: Niedersachsen
  • nw: Nordrhein-Westfalen
  • rp: Rheinland-Pfalz
  • sl: Saarland
  • sn: Sachsen
  • st: Sachsen-Anhalt
  • sh: Schleswig-Holstein
  • th: Thüringen

List of supported holidays

  • Neujahrstag
  • Heilige Drei Könige
  • Tag der Arbeit
  • Augsburger Friedensfest
  • Mariä Himmelfahrt
  • Tag der Deutschen Einheit
  • Reformationstag
  • Allerheiligen
  • Heiligabend
  • 1. Weihnachtstag
  • 2. Weihnachtstag
  • Silvester
  • Rosenmontag
  • Gründonnerstag
  • Karfreitag
  • Ostersonntag
  • Ostermontag
  • Christi Himmelfahrt
  • Pfingstsonntag
  • Pfingstmontag
  • Fronleichnam
  • Buß- und Bettag

Note that in 2017 Reformationstag is a holiday in all states.

To check which holidays are enabled for a state, call setState() and check the holidays object:

holiday.setState('nw');
console.log(holiday.holidays);

To enable a additional holidays, set them to true in the holidays object:

holiday.holidays.Rosenmontag = true;
holiday.holidays['Augsburger Friedensfest'] = true;

Author

Jonathan Diehl

Keywords

FAQs

Last updated on 19 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc