world-wide holidays in gregorian calender
This module provides dates of holidays for various countries, states and regions by type while considering the applicable timezone.
The features are:
- calculation of public, bank and observance holidays for different countries, state, region
- consideration of timezones for holiday checks
- substitute days
- multi-language support for all holiday names
- setting of custom holidays
- uses own grammar for calculation of days
- support for islamic calendar from 1970 to 2080 (*islamic dates might not be correct as they are subject to the sighting of the moon)
- support for hebrew calendar from 1970 to 2100
- for generation of iCal calendar check out date-holidays-ical
Happy holidays!
- Supported Countries, States, Regions
- Usage
- Holiday object
- API
- Data
- Custom builds of
holidays.json - Contribution and License Agreement
- License
- References
If you are missing holidays from your country, state, region please consider contributing.
Countries: 89
โโโ AD: Andorra
โ โโโ vella: Andorra la Vella
โโโ AM: ีีกีตีกีฝีฟีกีถ
โโโ AO: Angola
โโโ AR: Argentina
โโโ AT: รsterreich
โ โโโ b: Burgenland
โ โโโ k: Kรคrnten
โ โโโ n: Niederรถsterreich
โ โโโ o: Oberรถsterreich
โ โโโ s: Land Salzburg
โ โโโ st: Steiermark
โ โโโ t: Tirol
โ โโโ v: Vorarlberg
โ โโโ w: Wien
โโโ AU: Australia
โ โโโ act: Australian Capital Territory
โ โโโ nsw: New South Wales
โ โโโ nt: Northern Territory
โ โโโ qld: Queensland
โ โโโ sa: South Australia
โ โโโ tas: Tasmania
โ โ โโโ h: Hobart
โ โ โโโ nh: Non-Hobart
โ โโโ vic: Victoria
โ โ โโโ m: Melbourne
โ โโโ wa: Western Australia
โโโ BE: Belgique
โ โโโ de: Deutschsprachige Gemeinschaft
โ โโโ fr: Communautรฉ franรงaise
โ โ โโโ br: Bruxelles
โ โโโ vl: Vlaamse Gemeenschap
โโโ BG: ะัะปะณะฐัะธั
โโโ BI: Rรฉpublique du Burundi
โโโ BO: Bolivia
โโโ BR: Brasil
โโโ BS: Bahamas
โโโ BW: Botswana
โโโ BZ: Belize
โโโ CA: Canada
โ โโโ ab: Alberta
โ โโโ bc: British Columbia
โ โโโ mb: Manitoba
โ โโโ nb: New Brunswick
โ โโโ nl: Newfoundland and Labrador
โ โโโ ns: Nova Scotia
โ โโโ nt: Northwest Territories
โ โโโ nu: Nunavut
โ โโโ on: Ontario
โ โโโ pe: Prince Edward Island
โ โโโ qc: Quebec
โ โโโ sk: Saskatchewan
โ โโโ yt: Yukon
โโโ CD: Rรฉpublique dรฉmocratique du Congo
โโโ CF: Rรฉpublique centrafricaine
โโโ CG: Rรฉpublique du Congo
โโโ CH: Schweiz
โ โโโ zh: Kanton Zรผrich
โ โโโ be: Kanton Bern
โ โโโ lu: Kanton Luzern
โ โโโ ur: Kanton Uri
โ โโโ sz: Kanton Schwyz
โ โโโ ow: Kanton Obwalden
โ โโโ nw: Kanton Nidwalden
โ โโโ gl: Kanton Glarus
โ โโโ zg: Kanton Zug
โ โโโ fr: Kanton Freiburg
โ โโโ so: Kanton Solothurn
โ โโโ bs: Kanton Basel-Stadt
โ โโโ bl: Kanton Basel-Landschaft
โ โโโ sh: Kanton Schaffhausen
โ โโโ ar: Kanton Appenzell Ausserrhoden
โ โโโ ai: Kanton Appenzell Innerrhoden
โ โโโ sg: Kanton St. Gallen
โ โโโ gr: Kanton Graubรผnden
โ โโโ ag: Kanton Aargau
โ โโโ tg: Kanton Thurgau
โ โโโ ti: Kanton Tessin
โ โโโ vd: Kanton Waadt
โ โโโ vs: Kanton Wallis
โ โโโ ne: Kanton Neuenburg
โ โโโ ge: Kanton Genf
โ โโโ ju: Kanton Jura
โโโ CL: Chile
โ โโโ ar: Arica
โ โโโ ch: Chillรกn y Chillรกn Viejo
โ โโโ pa: Parinacota
โ โโโ ta: Tarapacรก
โโโ CM: Cameroun
โโโ CO: Colombia
โโโ CR: Costa Rica
โโโ CU: Cuba
โโโ CY: ฮฯฯฯฮฟฯ
โโโ CZ: ฤeskรก republika
โโโ DE: Deutschland
โ โโโ bb: Brandenburg
โ โโโ bw: Baden Wรผrtemberg
โ โโโ by: Bayern
โ โ โโโ a: Stadt Augsburg
โ โ โโโ evang: รberwiegend evangelische Gemeinden
โ โโโ hb: Hansestadt Bremen
โ โโโ he: Hessen
โ โโโ hh: Hansestadt Hamburg
โ โโโ mv: Mecklenburg Vorpommern
โ โโโ ni: Niedersachsen
โ โโโ nw: Nordrhein-Westfalen
โ โโโ rp: Rheinland-Pfalz
โ โโโ sh: Schleswig-Holstein
โ โโโ sl: Saarland
โ โโโ sn: Sachsen
โ โ โโโ bz: Landkreis Bautzen
โ โโโ st: Sachsen-Anhalt
โ โโโ th: Thรผringen
โ โโโ eic: Landkreis Eichfeld
โ โโโ uh: Unstrut-Hainich-Kreis
โ โโโ wak: Wartburgkreis
โโโ DK: Danmark
โโโ DO: Repรบblica Dominicana
โโโ EC: Ecuador
โ โโโ qu: Quito
โโโ EE: Eesti
โโโ ES: Espaรฑa
โ โโโ madrid: Comunidad de Madrid
โโโ ET: แขแตแฎแตแซ
โโโ FI: Suomi
โโโ FR: France
โ โโโ basrhin: Dรฉpartement Bas-Rhin
โ โโโ hautrhin: Dรฉpartement Haut-Rhin
โ โโโ moselle: Dรฉpartement Moselle
โ โโโ mayotte: Dรฉpartement et rรฉgion d'outre-mer Mayotte
โ โโโ martinique: Dรฉpartement et rรฉgion d'outre-mer Martinique
โ โโโ guadeloupe: Dรฉpartement et rรฉgion d'outre-mer Guadeloupe
โ โโโ guyane: Dรฉpartement et rรฉgion d'outre-mer Guyane
โ โโโ reunion: Dรฉpartement et rรฉgion d'outre-mer La Rรฉunion
โโโ GA: Gabon
โโโ GB: Britain
โ โโโ al: Alderney
โ โโโ en: England
โ โโโ gu: Guernsey
โ โโโ im: Isle of Man
โ โโโ je: Jersey
โ โโโ ni: Northern Ireland
โ โโโ sc: Scottland
โ โโโ wa: Wales
โโโ GD: Grenada
โโโ GQ: Repรบblica de Guinea Ecuatorial
โโโ GR: ฮฮปฮปฮฌฮดฮฑ
โโโ GT: Guatemala
โโโ GU: Guam
โโโ HN: Honduras
โโโ HR: Hrvatska
โ โโโ split: Split
โ โโโ dubrovnik: Dubrovnik
โโโ HT: Haรฏti
โโโ HU: Magyarorszรกg
โโโ IE: Ireland
โโโ IS: รsland
โโโ IT: Italia
โ โโโ suedtirol: Sรผdtirol, Alto Adige
โโโ JM: Jamaica
โโโ JP: ๆฅๆฌ
โโโ KE: Kenia
โโโ LI: Lichtenstein
โโโ LT: Lietuva
โโโ LU: Luxembourg
โโโ LV: Latvija
โโโ MC: Monaco
โโโ ME: Crna Gora
โโโ MG: Repoblikan'i Madagasikara
โโโ MT: Malta
โโโ MW: Malawi
โโโ MX: Mรฉxico
โโโ MZ: Moรงambique
โโโ NA: Namibia
โโโ NI: Nicaragua
โโโ NL: Nederland
โโโ NO: Norge
โโโ NZ: New Zealand
โ โโโ au: Auckland Province
โ โโโ ca: Canterbury
โ โโโ ch: Chatham Islands
โ โโโ ha: Hawke's Bay
โ โโโ ma: Marlborough
โ โโโ ne: Nelson
โ โโโ no: Northland
โ โโโ ot: Otago Province
โ โโโ sc: South Canterbury
โ โโโ so: Southland
โ โโโ ta: Taranaki
โ โโโ we: Wellington Province
โ โโโ wd: Westland
โโโ PA: Panamรก
โโโ PE: Perรบ
โ โโโ cu: Cuzco
โโโ PL: Polska
โโโ PT: Portugal
โโโ PY: Paraguay
โโโ RO: Romania
โโโ RU: ะ ะพััะธั
โโโ RW: Repubulika y'u Rwanda
โโโ SE: Sverige
โโโ SS: South Sudan
โโโ SV: El Salvador
โ โโโ san: San Salvador
โโโ TG: Rรฉpublique togolaise
โโโ TR: Tรผrkiye
โโโ TZ: Tanzania
โโโ UG: Uganda
โโโ US: United States of America
โ โโโ al: Alabama
โ โโโ ak: Alaska
โ โโโ az: Arizona
โ โโโ ar: Arkansas
โ โโโ ca: California
โ โโโ co: Colorado
โ โโโ ct: Connecticut
โ โโโ de: Delaware
โ โโโ dc: District of Columbia
โ โโโ fl: Florida
โ โโโ ga: Georgia
โ โโโ hi: Hawaii
โ โโโ id: Idaho
โ โโโ il: Illinois
โ โโโ in: Indiana
โ โโโ ia: Iowa
โ โโโ ks: Kansas
โ โโโ ky: Kentucky
โ โโโ la: Louisiana
โ โ โโโ no: New Orleans
โ โโโ me: Maine
โ โโโ md: Maryland
โ โโโ ma: Massachusetts
โ โโโ mi: Michigan
โ โโโ mn: Minnesota
โ โโโ ms: Mississippi
โ โโโ mo: Missouri
โ โโโ mt: Montana
โ โโโ ne: Nebraska
โ โโโ nv: Nevada
โ โโโ nh: New Hampshire
โ โโโ nj: New Jersey
โ โโโ nm: New Mexico
โ โโโ ny: New York
โ โโโ nc: North Carolina
โ โโโ nd: North Dakota
โ โโโ oh: Ohio
โ โโโ ok: Oklahoma
โ โโโ or: Oregon
โ โโโ pa: Pennsylvania
โ โโโ ri: Rhode Island
โ โโโ sc: South Carolina
โ โโโ sd: South Dakota
โ โโโ tn: Tennessee
โ โโโ tx: Texas
โ โโโ ut: Utah
โ โโโ vt: Vermont
โ โโโ va: Virginia
โ โโโ wa: Washington
โ โโโ wv: West Virginia
โ โโโ wi: Wisconsin
โ โโโ wy: Wyoming
โโโ UY: Uruguay
โโโ VE: Venezuela
โ โโโ an: Anzoรกtegui
โ โโโ ca: Carabobo
โ โโโ la: Lara
โ โ โโโ ba: Barquisimeto
โ โโโ mi: Miranda
โ โโโ mo: Monagas
โ โโโ ta: Tรกchira
โ โโโ zu: Zulia
โโโ ZA: South Africa
โโโ ZM: Zambia
โโโ ZW: Zimbabwe
var Holidays = require('date-holidays')
var hd = new Holidays()
// get supported countries
hd.getCountries()
/*>
{ AD: 'Andorra',
...
US: 'United States' }
*/
// get supported states e.g. for US
hd.getStates('US')
/*>
{ al: 'Alabama',
...
wy: 'Wyoming' }
*/
// get supported regions e.g. for US, Lousiana
hd.getRegions('US', 'la')
/*>
{ no: 'New Orleans' }
*/
// initialize holidays for US, Lousiana, New Orleans
hd.init('US', 'la', 'no')
// or using a new instance
hd = new Holidays('US', 'la', 'no')
// get all holidays for the year 2016
hd.getHolidays(2016)
/*>
[ { date: '2016-01-01 00:00:00',
start: Fri Jan 01 2016 00:00:00 GMT-0600 (CST),
end: Sat Jan 02 2016 00:00:00 GMT-0600 (CST),
name: 'New Year\'s Day',
type: 'public' },
...
{ date: '2016-11-24 00:00:00',
start: Thu Nov 24 2016 00:00:00 GMT-0600 (CST),
end: Fri Nov 25 2016 00:00:00 GMT-0600 (CST),
name: 'Thanksgiving Day',
type: 'public' },
...
{ date: '2016-12-26 00:00:00',
start: Mon Dec 26 2016 00:00:00 GMT-0600 (CST),
end: Tue Dec 27 2016 00:00:00 GMT-0600 (CST),
substitute: true,
name: 'Christmas Day (substitute day)',
type: 'public' } ]
*/
// check if date is a holiday while respecting timezones
hd.isHoliday(new Date('2016-02-09 00:00:00 GMT+0000'))
//> false
hd.isHoliday(new Date('2016-02-09 10:00:00 GMT-0600'))
/*>
{ date: '2016-02-09 00:00:00',
start: Tue Feb 09 2016 00:00:00 GMT-0600 (CST),
end: Wed Feb 10 2016 00:00:00 GMT-0600 (CST),
name: 'Mardi Gras',
type: 'public' }
*/getHolidays() as well as a matching isHoliday() call return either a list or a single holiday object which consists of:
- {String} date - ISO Date String of (start)-date in local format
- {Date} start - start date of holiday
- {Date} end - end date of holiday
- {String} name - name of holiday using
language(if available) - {String} type - type of holiday
public|bank|school|observance - {Boolean} substitute - (optional) if true holiday substitutes another holiday`
The date String represents the start date of the holiday in ISO format without timezone.
This string it intented for information only.
start and end are the start/end date of the holiday within the selected timezone of the country, state, region.
The name names the holiday in the local language of the selected country, state, region. The applied language(s) can be requested using getLanguages().
The language can be changed using the setLanguages() method. In case that not translation is available a fallback to the next given language will be made. E.g. local language is "fr", setLanguages('nl') was called. For all holidays where no dutch translation is available the french version will be used instead.
All holiday names should support an english translation.
Currently the following type with their meaning are supported
| type | meaning |
|---|---|
| public | public holiday |
| bank | bank holiday, banks and offices are closed |
| school | school holiday, schools are closed |
| optional | majority of people take a day off |
| observance | optional festivity, no paid day off |
Additionally a note field is sometimes available for further clarification.
See Holidays API for further information.
All data for the holidays of the different countries is contained in ./data/holidays.yaml. Any details on structure and available grammar for holiday attribution is described in holidays.yaml specification.
If only selected countries are required in data/holidays.json you can add the following script to your npm scripts section. E.g. for picking just US, Canada, Mexico do the following:
"scripts": {
"build": "holidays2json --pick US,CA,MX"
},Alternatively you may use the --omit option.
Manually use
$(npm bin)/holidays2json --pick US,CA,MXNOTE: There are some countries which depend on data of others which might render the file useless. e.g. "GU" requires "US", so try to pick or omit both.
You like to contribute please read CONTRIBUTING.md.
If you contribute code to this project, you are implicitly allowing your code to be distributed under the ISC license. You are also implicitly verifying that all code is your original work or correctly attributed with the source of its origin and licence.
Copyright (c) 2016 commenthol (ISC License)
The data contained in holidays.yaml is available under CC BY-SA 3.0 as the majority of data obtained relies on wikipedia articles.
The required attribution can be found inside the file
./data/holidays.yaml.
See LICENSE for more information.