1.3.3 • Published 6 years ago
hollidays v1.3.3
holidays
Supported countries
- Slovakia
- Czech Republic
- Austria
var holidays = require('holidays');
//get supported countries
holidays.getCountries();
/*
['sk','cz','at]
*/
//initialize for Austria, Kärnten
holidays.setCountry('at','k');
//get supported states of country
holidays.getStates();
/*
[ 'b', 'k', 'n', 'o', 's', 'st', 't', 'v', 'w' ]
*/
//get all holidays for year
holidays.findAll(2018);
/*
[{
"name": "Deň vzniku Slovenskej republiky",
"date": "1.1"
},
{
"name": "Zjavenie Pána (Traja králi)",
"date": "6.1"
},
...]
*/
//find if this day is a holiday
holidays.getByDate(2018,1,1)
/*
{ name: 'Neujahr', date: '1.1' }
*/