Slovak public holidays
Slovensky
NPM module which is able to calculate Slovak public holidays since 1993 to the future. It is pure Node.js code without any dependencies.
Usage
npm install slovak-holidays
import {isHoliday, getAllHolidays, getHolidayName} from 'slovak-holidays';
API
isHoliday(date|object): boolean
Calculate if a given date|object
is a holiday.
parameter
date
- instance of Javascript Date objectobject
- holiday object {year: integer, month: integer: day: integer}
isHoliday(new Date(1993, 0, 1))
isHoliday(new Date(1993, 0, 2))
isHoliday(new Date(2019, 3, 19))
isHoliday({year: 1993, month: 1, day: 1})
isHoliday({year: 1993, month: 1, day: 2})
isHoliday({year: 1993, month: 4, day: 19})
getAllHolidays(year): array
Returns all holidays for a given year
chronologically.
getAllHolidays(1992)
getAllHolidays(null)
getAllHolidays(2019)
getHolidayName(date|object): string|null
Returns a holiday name for a given date|object
if a holiday, otherwise null
.
parameter
date
- instance of Javascript Date objectobject
- holiday object {year: integer, month: integer: day: integer}
getHolidayName(new Date(1993, 0, 1))
getHolidayName(new Date(1993, 0, 2))
getHolidayName(new Date(2019, 3, 19))
getHolidayName({year: 1993, month: 1, day: 1})
getHolidayName({year: 1993, month: 1, day: 2})
getHolidayName({year: 1993, month: 4, day: 19})