1.2.0 • Published 8 years ago

german-holiday v1.2.0

Weekly downloads
11
License
MIT
Repository
github
Last release
8 years ago

german-holiday for NodeJS

This Module accepts a JS date object and returns state-specific either the name of a holiday or false. It could be helpful in calendar- or schedulingapplications.

Installation

Installation of german-holiday is as easy as every other NPM-package.

$ npm install german-holiday

##Usage Call the holidayCheck function and pass two arguments.

  • First argument: A JavaScript Date Object.
  • Second argument: The short form of a german state as string.

Possible short forms:

shortstate
BWBaden-Württemberg
BYBayern
BEBerlin
BBBrandenburg
HBBremen
HHHamburg
HEHessen
MVMecklenburg-Vorpommern
NINiedersachsen
NWNordrhein-Westfalen
RPRheinland-Pfalz
SLSaarland
SNSachsen
STSachsen-Anhalt
SHSchleswig-Holstein
THThüringen

##Examples Input:

var hcheck = require("german-holiday")
console.log(hcheck.holidayCheck(new Date(2015, 11, 25), "NW"))

Output:

'1. Weihnachtstag'

Input:

var hcheck = require("german-holiday")
console.log(hcheck.holidayCheck(new Date(2015, 11, 27), "BB"))

Output:

false