{"id":18610569,"url":"https://github.com/ixnode/php-public-holiday","last_synced_at":"2026-02-02T20:38:52.332Z","repository":{"id":249176109,"uuid":"830710681","full_name":"ixnode/php-public-holiday","owner":"ixnode","description":"This PHP package automatically generates holidays for a given year, considering both federal states and the country. It provides an easy-to-use interface to retrieve public holidays based on specific regions, ensuring accurate and up-to-date holiday information for all supported areas.","archived":false,"fork":false,"pushed_at":"2024-12-05T22:48:26.000Z","size":116,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T05:18:35.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixnode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2024-07-18T20:31:57.000Z","updated_at":"2024-12-14T11:34:32.000Z","dependencies_parsed_at":"2024-12-05T21:23:22.074Z","dependency_job_id":"7d11ffa4-5eb1-4453-846d-0d27329cd9c1","html_url":"https://github.com/ixnode/php-public-holiday","commit_stats":null,"previous_names":["ixnode/php-public-holiday"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/ixnode/php-public-holiday","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-public-holiday","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-public-holiday/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-public-holiday/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-public-holiday/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixnode","download_url":"https://codeload.github.com/ixnode/php-public-holiday/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-public-holiday/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29019460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T03:11:05.579Z","updated_at":"2026-02-02T20:38:52.318Z","avatar_url":"https://github.com/ixnode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Public Holiday\r\n\r\n[![Release](https://img.shields.io/github/v/release/ixnode/php-public-holiday)](https://github.com/ixnode/php-public-holiday/releases)\r\n[![](https://img.shields.io/github/release-date/ixnode/php-public-holiday)](https://github.com/ixnode/php-public-holiday/releases)\r\n![](https://img.shields.io/github/repo-size/ixnode/php-public-holiday.svg)\r\n[![PHP](https://img.shields.io/badge/PHP-^8.2-777bb3.svg?logo=php\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://www.php.net/supported-versions.php)\r\n[![PHPStan](https://img.shields.io/badge/PHPStan-Level%20Max-777bb3.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)\r\n[![PHPUnit](https://img.shields.io/badge/PHPUnit-Unit%20Tests-6b9bd2.svg?style=flat)](https://phpunit.de)\r\n[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-416d4e.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)\r\n[![PHPMD](https://img.shields.io/badge/PHPMD-ALL-364a83.svg?style=flat)](https://github.com/phpmd/phpmd)\r\n[![Rector - Instant Upgrades and Automated Refactoring](https://img.shields.io/badge/Rector-PHP%208.2-73a165.svg?style=flat)](https://github.com/rectorphp/rector)\r\n[![LICENSE](https://img.shields.io/github/license/ixnode/php-api-version-bundle)](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)\r\n\r\n\u003e This PHP package automatically generates holidays for a given year, considering both federal states and the country.\r\n\u003e It provides an easy-to-use interface to retrieve public holidays based on specific regions, ensuring accurate and\r\n\u003e up-to-date holiday information for all supported areas. Movable public holidays such as Easter Monday are calculated\r\n\u003e automatically using the PHP function `easter_date()`. Static public holidays are permanently stored.\r\n\r\n## 1. Usage\r\n\r\n```php\r\nuse Ixnode\\PhpPublicHoliday\\PublicHoliday;\r\n```\r\n\r\n### 1.1 Get the public holidays of Germany from the state of Saxony\r\n\r\n```php\r\n$year = 2024;\r\n$country = 'DE';\r\n$state = 'SN';\r\n$locale = 'de';\r\n\r\n$holiday = new PublicHoliday(year: $year, countryCode: $country, stateCode: $state, localeCode: $locale);\r\n\r\nprint_r($holiday-\u003egetHolidays());\r\n// (array) [Ixnode\\PhpPublicHoliday\\PublicHolidayItem Object, ...]\r\n// - (DateTimeImmutable) -\u003egetDate()\r\n// - (string) -\u003egetName()\r\n```\r\n\r\n## 2. Supported countries\r\n\r\n| Code | Country     | States                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Support                              |\r\n|------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|\r\n| `AT` | Austria     | Burgenland (`B`), Carinthia (`K`), Lower Austria (`N`), Upper Austria (`O`), Salzburg (`S`), Styria (`ST`), Tyrol (`T`), Vorarlberg (`V`), Vienna (`W`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | _fully supported_ :heavy_check_mark: |\r\n| `CH` | Switzerland | Canton of Zurich (`ZH`), Canton of Bern (`BE`), Canton of Lucerne (`LU`), Canton of Uri (`UR`), Canton of Schwyz (`SZ`), Canton of Obwalden (`OW`), Canton of Nidwalden (`NW`), Canton of Glarus (`GL`), Canton of Zug (`ZG`), Canton of Fribourg (`FR`), Canton of Solothurn (`SO`), Canton of Basel-Stadt (`BS`), Canton of Basel-Landschaft (`BL`), Canton of Schaffhausen (`SH`), Canton of Appenzell Ausserrhoden (`AR`), Canton of Appenzell Innerrhoden (`AI`), Canton of St. Gallen (`SG`), Canton of the Grisons (`GR`), Canton of Aargau (`AG`), Canton of Thurgau (`TG`), Canton of Ticino (`TI`), Canton of Vaud (`VD`), Canton of Valais (`VS`), Canton of Neuchâtel (`NE`), Canton of Geneva (`GE`), Canton of Jura (`JU`) | _fully supported_ :heavy_check_mark: |\r\n| `DE` | Germany     | Brandenburg (`BB`), Berlin (`BE`), Baden Württemberg (`BW`),  Bavaria (`BY`), Bremen (`HB`), Hesse (`HE`), Hamburg (`HH`), Mecklenburg-Western Pomerania (`MV`), Lower Saxony (`NI`), Nordrhein-Westfalen (`NW`), Rhineland-Palatinate (`RP`), Schleswig-Holstein (`SH`), Saarland (`SL`), Saxony (`SN`), Sachsen-Anhalt (`ST`), Thuringia (`TH`)                                                                                                                                                                                                                                                                                                                                                                                        | _fully supported_ :heavy_check_mark: |\r\n\r\n## 3. Supported languages\r\n\r\n| Code | Language | Support                              |\r\n|------|----------|--------------------------------------|\r\n| `cz` | Czech    | _fully supported_ :heavy_check_mark: |\r\n| `de` | German   | _fully supported_ :heavy_check_mark: |\r\n| `en` | English  | _fully supported_ :heavy_check_mark: |\r\n| `es` | Spanish  | _fully supported_ :heavy_check_mark: |\r\n| `fr` | French   | _fully supported_ :heavy_check_mark: |\r\n| `hr` | Croatian | _fully supported_ :heavy_check_mark: |\r\n| `it` | Italian  | _fully supported_ :heavy_check_mark: |\r\n| `pl` | Polish   | _fully supported_ :heavy_check_mark: |\r\n| `sv` | Swedish  | _fully supported_ :heavy_check_mark: |\r\n\r\n## 4. Installation\r\n\r\n```bash\r\ncomposer require ixnode/php-public-holiday\r\n```\r\n\r\n```bash\r\nvendor/bin/php-public-holiday -V\r\n```\r\n\r\n```bash\r\nphp-public-holiday 1.0.0 (2024-11-23 15:08:05) - Björn Hempel \u003cbjoern@hempel.li\u003e\r\n```\r\n\r\n## 5. Command line tool\r\n\r\n\u003e Used to quickly check the public holidays.\r\n\r\ndevelopment mode:\r\n\r\n```bash\r\nbin/console ph DE SN --year=2024\r\n```\r\n\r\nor within your composer project:\r\n\r\n```bash\r\nvendor/bin/php-public-holiday ph DE SN --year=2024\r\n```\r\n\r\n```bash\r\n\r\nYear:    2024\r\nCountry: DE (Deutschland)\r\nState:   SN (Sachsen)\r\nLocale:  de (Deutsch)\r\n\r\n- 2024-01-01: Neujahr\r\n- 2024-03-29: Karfreitag\r\n- 2024-03-31: Ostersonntag\r\n- 2024-04-01: Ostermontag\r\n- 2024-05-01: Tag der Arbeit\r\n- 2024-05-09: Christi Himmelfahrt\r\n- 2024-05-19: Pfingstsonntag\r\n- 2024-05-20: Pfingstmontag\r\n- 2024-05-30: Fronleichnam\r\n- 2024-10-03: Tag der deutschen Einheit\r\n- 2024-10-31: Reformationstag\r\n- 2024-11-20: Buß- und Bettag\r\n- 2024-12-25: Erster Weihnachtsfeiertag\r\n- 2024-12-26: Zweiter Weihnachtsfeiertag\r\n\r\n```\r\n\r\n### Output locales (`--locale`)\r\n\r\nAvailable options:\r\n\r\n* `cz`\r\n* `de` (default)\r\n* `en`\r\n* `es`\r\n* `fr`\r\n* `hr`\r\n* `it`\r\n* `pl`\r\n* `sv`\r\n\r\n```bash\r\nvendor/bin/php-public-holiday ph DE SN --year=2025 --locale=en --format=text\r\n```\r\n\r\n```bash\r\n\r\nYear:    2025\r\nCountry: DE (Germany)\r\nState:   SN (Saxony)\r\nLocale:  en (English)\r\n\r\n- 2025-01-01: New Year\r\n- 2025-04-18: Good Friday\r\n- 2025-04-20: Easter Sunday\r\n- 2025-04-21: Easter Monday\r\n- 2025-05-01: Labour Day\r\n- 2025-05-29: Feast of the Ascension\r\n- 2025-06-08: Whit Sunday\r\n- 2025-06-09: Whit Monday\r\n- 2025-06-19: Feast of Corpus Christi\r\n- 2025-10-03: German Unity Day\r\n- 2025-10-31: Reformation Day\r\n- 2025-11-19: Buß- und Bettag\r\n- 2025-12-25: Christmas Day\r\n- 2025-12-26: Boxing Day\r\n\r\n```\r\n\r\n```bash\r\nvendor/bin/php-public-holiday ph AT K --year=2025 --locale=sv --format=text\r\n```\r\n\r\n```bash\r\n\r\nYear:    2025\r\nCountry: AT (Österrike)\r\nState:   K (Kärnten)\r\nLocale:  sv (Svenska)\r\n\r\n- 2025-01-01: Nyår (39 days)\r\n- 2025-01-06: Tre vise männen (44 days)\r\n- 2025-04-20: Påskdagen (147 days)\r\n- 2025-04-21: Annandag påsk (148 days)\r\n- 2025-05-01: Bankdagar (159 days)\r\n- 2025-05-29: Kristi himmelsfärdsdag (186 days)\r\n- 2025-06-08: Pingst (196 days)\r\n- 2025-06-09: Annandag pingst (197 days)\r\n- 2025-06-19: Corpus Christi (207 days)\r\n- 2025-08-15: Jungfru Marie himmelsfärd (265 days)\r\n- 2025-10-26: Nationaldag (337 days)\r\n- 2025-11-01: Alla helgons dag (343 days)\r\n- 2025-12-08: Obefläckade avlelsen (380 days)\r\n- 2025-12-25: Jul (397 days)\r\n- 2025-12-26: Stefani dag (398 days)\r\n\r\n```\r\n\r\n### Output formats (`--format`)\r\n\r\nAvailable options:\r\n\r\n* `text` (default)\r\n* `json`\r\n* `csv`\r\n\r\n#### JSON\r\n\r\n```bash\r\nvendor/bin/php-public-holiday ph DE SN --year=2025 --format=json\r\n```\r\n\r\n```json\r\n{\r\n    \"country\": \"DE\",\r\n    \"state\": \"SN\",\r\n    \"year\": 2025,\r\n    \"locale\": \"de\",\r\n    \"holidays\": [\r\n        {\r\n            \"date\": \"2025-01-01\",\r\n            \"name\": \"Neujahr\"\r\n        },\r\n        ...\r\n    ]\r\n}\r\n```\r\n\r\n#### CSV\r\n\r\n```bash\r\nvendor/bin/php-public-holiday ph DE SN --year=2025 --format=csv\r\n```\r\n\r\n```csv\r\ndate;\"public holiday\"\r\n2025-01-01;Neujahr\r\n2025-04-18;Karfreitag\r\n...\r\n```\r\n\r\n## 6. Library development\r\n\r\n```bash\r\ngit clone git@github.com:ixnode/php-public-holiday.git \u0026\u0026 cd php-public-holiday\r\n```\r\n\r\n```bash\r\ncomposer install\r\n```\r\n\r\n```bash\r\ncomposer test\r\n```\r\n\r\n## 7. License\r\n\r\nThis library is licensed under the MIT License - see the [LICENSE](/LICENSE.md) file for details.\r\n\r\n## 8. Author\r\n\r\n* Björn Hempel \u003cbjoern@hempel.li\u003e\r\n* https://www.hempel.li/\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-public-holiday","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixnode%2Fphp-public-holiday","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-public-holiday/lists"}