{"id":19621369,"url":"https://github.com/commenthol/date-holidays-parser","last_synced_at":"2025-04-09T14:12:55.704Z","repository":{"id":26642198,"uuid":"109435489","full_name":"commenthol/date-holidays-parser","owner":"commenthol","description":"parser for worldwide holidays","archived":false,"fork":false,"pushed_at":"2023-05-12T16:44:45.000Z","size":503,"stargazers_count":45,"open_issues_count":7,"forks_count":21,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-23T23:14:56.984Z","etag":null,"topics":["holidays","parser","worldwide"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-03T19:33:35.000Z","updated_at":"2024-06-18T15:16:38.072Z","dependencies_parsed_at":"2024-06-18T15:16:27.322Z","dependency_job_id":"a82b662a-6832-401d-b1e3-7303b453635d","html_url":"https://github.com/commenthol/date-holidays-parser","commit_stats":{"total_commits":279,"total_committers":10,"mean_commits":27.9,"dds":0.05734767025089604,"last_synced_commit":"07263fa2aceaf83c59c7ff5dd3a8c5ae558e5674"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fdate-holidays-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fdate-holidays-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fdate-holidays-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fdate-holidays-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/date-holidays-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054193,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["holidays","parser","worldwide"],"created_at":"2024-11-11T11:22:41.540Z","updated_at":"2025-04-09T14:12:55.666Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# date-holidays-parser\n\n\u003e parser for world-wide holidays\n\n[![NPM version](https://badge.fury.io/js/date-holidays-parser.svg)](https://www.npmjs.com/package/date-holidays-parser/)\n[![Build Status](https://github.com/commenthol/date-holidays-parser/workflows/CI/badge.svg?branch=master\u0026event=push)](https://github.com/commenthol/date-holidays-parser/actions/workflows/ci.yml?query=branch%3Amaster)\n\nThis module provides a parser for [date-holidays][] which does calculation of\nholidays dates for various countries, states and regions by type while\nconsidering the applicable timezone.\n\nThe features are:\n\n- calculation of public, bank and observance holidays for different\n  countries, state, region, following ISO 3166-2\n- consideration of timezones for holiday checks\n- consideration of start and end time dependent on timezone\n- substitute days\n- multi-language support for all holiday names\n- setting of custom holidays\n- uses own grammar for calculation of days\n- support for islamic calendar from 1970 to 2080 (*islamic dates might\n  not be correct as they are subject to the sighting of the moon)\n- support for hebrew calendar from 1970 to 2100\n- support for chinese calendar\n\nHappy holidays!\n\n## Table of Contents\n\n\u003c!-- !toc (minlevel=2 omit=\"Table of Contents\") --\u003e\n\n* [Usage](#usage)\n* [Holiday object](#holiday-object)\n  * [Dates](#dates)\n  * [Name](#name)\n  * [Types of holidays](#types-of-holidays)\n* [API](#api)\n* [Browser](#browser)\n* [Data](#data)\n* [Contribution and License Agreement](#contribution-and-license-agreement)\n* [License](#license)\n* [References](#references)\n\n\u003c!-- toc! --\u003e\n\n## Usage\n\n```js\nconst data = require('date-holidays/data/holidays.json')\nconst Holidays = require('date-holidays-parser')\nconst hd = new Holidays(data)\n\n// get supported countries\nhd.getCountries()\n/*\u003e\n{ AD: 'Andorra',\n  ...\n  US: 'United States' }\n*/\n\n// get supported states e.g. for US\nhd.getStates('US')\n/*\u003e\n{ al: 'Alabama',\n  ...\n  wy: 'Wyoming' }\n*/\n\n// get supported regions e.g. for US, Lousiana\nhd.getRegions('US', 'la')\n/*\u003e\n{ no: 'New Orleans' }\n*/\n\n// initialize holidays for US, Lousiana, New Orleans\nhd.init('US', 'la', 'no')\n// or using a new instance\nhd = new Holidays('US', 'la', 'no')\n\n// get all holidays for the year 2016\nhd.getHolidays(2016)\n/*\u003e\n[ { date: '2016-01-01 00:00:00',\n    start: Fri Jan 01 2016 00:00:00 GMT-0600 (CST),\n    end: Sat Jan 02 2016 00:00:00 GMT-0600 (CST),\n    name: 'New Year\\'s Day',\n    type: 'public' },\n  ...\n  { date: '2016-11-24 00:00:00',\n    start: Thu Nov 24 2016 00:00:00 GMT-0600 (CST),\n    end: Fri Nov 25 2016 00:00:00 GMT-0600 (CST),\n    name: 'Thanksgiving Day',\n    type: 'public' },\n  ...\n  { date: '2016-12-26 00:00:00',\n    start: Mon Dec 26 2016 00:00:00 GMT-0600 (CST),\n    end: Tue Dec 27 2016 00:00:00 GMT-0600 (CST),\n    substitute: true,\n    name: 'Christmas Day (substitute day)',\n    type: 'public' } ]\n*/\n\n// check if date is a holiday while respecting timezones\nhd.isHoliday(new Date('2016-02-09 00:00:00 GMT+0000'))\n//\u003e false\nhd.isHoliday(new Date('2016-02-09 10:00:00 GMT-0600'))\n/*\u003e\n{ date: '2016-02-09 00:00:00',\n  start: Tue Feb 09 2016 00:00:00 GMT-0600 (CST),\n  end: Wed Feb 10 2016 00:00:00 GMT-0600 (CST),\n  name: 'Mardi Gras',\n  type: 'public' }\n*/\n```\n\n## Holiday object\n\n`getHolidays()` as well as a matching `isHoliday()` call return either\na list or a single holiday object which consists of:\n\n* {String} date - ISO Date String of (start)-date in local format\n* {Date} start - start date of holiday\n* {Date} end - end date of holiday\n* {String} name - name of holiday using `language` (if available)\n* {String} type - type of holiday `public|bank|school|optional|observance`\n* {Boolean} substitute - (optional) if true holiday substitutes another holiday`\n* {String} note - (optional) note`\n\n### Dates\n\nThe `date` String represents the start date of the holiday in ISO\nformat without timezone. This string it intended for information only.\n\n`start` and `end` are the start/end date of the holiday within the\nselected timezone of the country, state, region.\n\n### Name\n\nThe `name` names the holiday in the local language of the selected\ncountry, state, region. The applied language(s) can be requested using\n`getLanguages()`.\n\nThe language can be changed using the `setLanguages()` method. In case\nthat not translation is available a fall-back to the next given\nlanguage will be made. E.g. local language is \"fr\",\n`setLanguages('nl')` was called. For all holidays where no dutch\ntranslation is available the French version will be used instead.\n\nAll holiday names should support an English translation.\n\n### Types of holidays\n\nCurrently the following type with their meaning are supported\n\ntype        | meaning                                   \n----------- | ------------------------------------------\npublic      | public holiday                            \nbank        | bank holiday, banks and offices are closed\nschool      | school holiday, schools are closed        \noptional    | majority of people take a day off         \nobservance  | optional festivity, no paid day off       \n\nAdditionally a `note` field is sometimes available for further\nclarification.\n\n## API\n\nSee [Holidays API][] for further information.\n\n## Browser\n\nThis project also runs in all modern browsers. See `./examples/browser`\n\nBrowser | Version | Notes\n---     | ---     | ---\nChrome  | \u003e=45    |\nFirefox | \u003e=45    |\nSafari  | \u003e=10    |\nEdge    | \u003e=13    |\nIE      | \u003e=10    | needs polyfill `core-js/es6`\n\nPlease do not forget to set the correct charset!\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n  \u003c!-- set page-wide --\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  ...\n\u003c/head\u003e\n\u003cbody\u003e\n  ...\n  \u003c!-- or per script --\u003e\n  \u003cscript src=\"your-bundle.js\" charset=\"UTF-8\"\u003e\u003c/script\u003e\n```\n\nTesting was done with `zuul`. For local browser tests run `npm run zuul\n-- --local 3000` and open \u003chttp://localhost:3000/__zuul\u003e.\n\nrequires manual install of\n\n```\nnpm i zuul@3 browserify@10\n```\n\n## Data\n\nAll data for the holidays of the different countries is contained in\n[`./data/holidays.json`](./data/holidays.json). For changing holiday\ndata edit the appropriate country in `./data/countries`. Any details on\nstructure and available grammar for holiday attribution is described in\n[holidays.yaml specification][].\n\n## Contribution and License Agreement\n\nIf you contribute code to this project, you are implicitly allowing your\ncode to be distributed under the ISC license. You are also implicitly\nverifying that all code is your original work or correctly attributed\nwith the source of its origin and license.\n\n## License\n\nCopyright (c) 2015-present commenthol ([ISC License][])\n\nSee [LICENSE][] for more information.\n\n## References\n\n\u003c!-- !ref --\u003e\n\n* [date-holidays][date-holidays]\n* [date-holidays-ical][date-holidays-ical]\n* [Holidays API][Holidays API]\n* [holidays.yaml specification][holidays.yaml specification]\n* [ISC License][ISC License]\n* [LICENSE][LICENSE]\n\n\u003c!-- ref! --\u003e\n\n[LICENSE]: ./LICENSE\n[holidays.yaml specification]: https://github.com/commenthol/date-holidays/docs/specification.md\n[Holidays API]: https://github.com/commenthol/date-holidays-parser/blob/master/docs/Holidays.md\n[date-holidays]: https://github.com/commenthol/date-holidays\n[date-holidays-ical]: https://github.com/commenthol/date-holidays-ical\n[ISC License]: http://opensource.org/licenses/ISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fdate-holidays-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fdate-holidays-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fdate-holidays-parser/lists"}