Coder Social home page Coder Social logo

holiday-de's Introduction

Build Status Coverage Status Dependency 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

holiday-de's People

Contributors

jdiehl avatar ahelmberger avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.