JSPM

german-holiday

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 194
  • Score
    100M100P100Q109150F
  • License MIT

Check whether a date is a german holiday

Package Exports

  • german-holiday

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (german-holiday) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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:

short state
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

##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