PHPackages                             michalmanko/php-library-holiday - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. michalmanko/php-library-holiday

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

michalmanko/php-library-holiday
===============================

A library to calculate holidays

1.1.0(10y ago)2177.0k—5.5%11[3 PRs](https://github.com/michalmanko/php-library-holiday/pulls)1MITPHPPHP &gt;=5.3.23

Since Jul 18Pushed 9y ago3 watchersCompare

[ Source](https://github.com/michalmanko/php-library-holiday)[ Packagist](https://packagist.org/packages/michalmanko/php-library-holiday)[ RSS](/packages/michalmanko-php-library-holiday/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (1)

Michalmanko/Holiday
===================

[](#michalmankoholiday)

[![Build Status](https://camo.githubusercontent.com/b6fa625a2be9d14d3d0d27613bdd27152587f3ce93885f15ba66bacb192effae/68747470733a2f2f7472617669732d63692e6f72672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/michalmanko/php-library-holiday)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/22f3d470b0a8cff3fbc6814a2bb5515b4a73803024477bace075ef487766b8bd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/michalmanko/php-library-holiday/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/5a9b2203b2f96a300620101d141a2811e204c958241ed557b1acb446b8b98403/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/michalmanko/php-library-holiday/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/f1df827e7a8200a7fd21058712d25ef8632fc4c7e7ec9ac0d0313e1f3fe36a55/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535363063616235333636343636303031663063303030302f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/5560cab5366466001f0c0000)

[![Latest Stable Version](https://camo.githubusercontent.com/a49863be6180ee4df6ead0c34f1d666db449babed008fbf373a879f145ded1e4/68747470733a2f2f706f7365722e707567782e6f72672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f762f737461626c652e737667)](https://packagist.org/packages/michalmanko/php-library-holiday)[![Latest Unstable Version](https://camo.githubusercontent.com/977a67e7d51f3a99ca929a18556cdfff57dee0df4c4b499c13e305f696356845/68747470733a2f2f706f7365722e707567782e6f72672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f762f756e737461626c652e737667)](https://packagist.org/packages/michalmanko/php-library-holiday)

[![License](https://camo.githubusercontent.com/de08725c8db1dd0f33e3e20fd07418584ac3b8853f3c2d2c0420f2bdb084c2b7/68747470733a2f2f706f7365722e707567782e6f72672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f6c6963656e73652e737667)](https://packagist.org/packages/michalmanko/php-library-holiday)[![Total Downloads](https://camo.githubusercontent.com/45d6bec8be78a13f1e183775417a405d1f81aac1adf789d90304fbe82a2ff007/68747470733a2f2f706f7365722e707567782e6f72672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f646f776e6c6f6164732e737667)](https://packagist.org/packages/michalmanko/php-library-holiday)[![Monthly Downloads](https://camo.githubusercontent.com/a3e4af715ec1723ef20e051ab2589c0793c83c242281d15b10edd7216288ab9a/68747470733a2f2f706f7365722e707567782e6f72672f6d696368616c6d616e6b6f2f7068702d6c6962726172792d686f6c696461792f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/michalmanko/php-library-holiday)

Michalmanko/Holiday is a small library to check if a specified date is a holiday in a specific country.

Requirements
------------

[](#requirements)

Michalmanko/Holiday requires PHP 5.3.23 or later.

Installation
------------

[](#installation)

### Composer

[](#composer)

The easiest way to install this library is through [composer](http://getcomposer.org/). Just add the following lines to your **composer.json** file:

```
{
   "require": {
        "michalmanko/php-library-holiday": "~1.1.0"
    }
}
```

### Manually

[](#manually)

Another way would be to download this library and configure the autoloading yourself. This library relies on a [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) compatible autoloader for automatic class loading.

Usage
-----

[](#usage)

Get a provider
--------------

[](#get-a-provider)

```
$providerByIso = \Michalmanko\Holiday\HolidayFactory::createProvider('PL');
$providerByCountry = \Michalmanko\Holiday\HolidayFactory::createProvider('Poland');
$providerByClassName = \Michalmanko\Holiday\HolidayFactory::createProvider('\\Michalmanko\\Holiday\\Provider\\Poland');
```

You can select provider by two-letter [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country codes, country name or just a class name.

Check holidays
--------------

[](#check-holidays)

To check for holidays just create the provider for specific country and call the `getHolidays` method.

```
$provider = \Michalmanko\Holiday\HolidayFactory::createProvider('PL');
$holidays = $provider->getHolidays(new \DateTime('2014-01-01'));
```

If you just need to know if there is a holiday on your date or time period there are `isHoliday` and `hasHolidays` methods, too.

If you need to know all holidays for a specific country you can call the `getHolidaysByYear` method.

License
-------

[](#license)

Michalmanko\\Holiday is licensed under the MIT License, see the [`LICENSE.md`](LICENSE.md) file for more details.

Changelog
---------

[](#changelog)

See the [`CHANGELOG.md`](CHANGELOG.md) file for more details.

Contributing
------------

[](#contributing)

Michalmanko/Holiday is open source. Everyone is more than welcome to [`contribute`](CONTRIBUTING.md) more of them. If you use this library it would be great to get some support for currently not implemented countries which you are familiar with. Pull requests will be reviewed and merged fast.

To create a new Provider please see the [`\Michalmanko\Holiday\Provider\Poland`](src/Michalmanko/Holiday/Provider/Poland.php) class as an example.

Running Tests
-------------

[](#running-tests)

Run a `php composer install` command in the base directory to install the `phpunit` dependency. After that you can simply call `vendor/bin/phpunit -c phpunit.xml.dist` to run the test suite.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~79 days

Total

5

Last Release

4006d ago

Major Versions

0.2.0 → 1.0.02015-05-23

PHP version history (2 changes)0.1.0PHP &gt;=5.3

1.0.0PHP &gt;=5.3.23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3833458?v=4)[Michał Mańko](/maintainers/michalmanko)[@michalmanko](https://github.com/michalmanko)

---

Top Contributors

[![michalmanko](https://avatars.githubusercontent.com/u/3833458?v=4)](https://github.com/michalmanko "michalmanko (20 commits)")[![adamschoenemann](https://avatars.githubusercontent.com/u/2095226?v=4)](https://github.com/adamschoenemann "adamschoenemann (4 commits)")[![aripringle](https://avatars.githubusercontent.com/u/1278449?v=4)](https://github.com/aripringle "aripringle (2 commits)")[![lsv](https://avatars.githubusercontent.com/u/20708?v=4)](https://github.com/lsv "lsv (2 commits)")

---

Tags

holidaypolish holidaysdanish holidays

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/michalmanko-php-library-holiday/health.svg)

```
[![Health](https://phpackages.com/badges/michalmanko-php-library-holiday/health.svg)](https://phpackages.com/packages/michalmanko-php-library-holiday)
```

###  Alternatives

[geoffreyrose/us-holidays

US Holidays Wrapper for the Carbon DateTime Library.

62717.0k2](/packages/geoffreyrose-us-holidays)[checkdomain/holiday

Checkdomain/Holiday provides a simple class to get holidays for a specified country

50384.1k2](/packages/checkdomain-holiday)[holidayapi/holidayapi-php

Official PHP library for Holiday API

35213.3k1](/packages/holidayapi-holidayapi-php)[citco/carbon

This is a wrapper for nesbot/carbon which also calculates which days are British bank holidays (England &amp; Wales only).

17400.1k5](/packages/citco-carbon)[holiday-jp/holiday_jp

Japanese holidays

20161.3k](/packages/holiday-jp-holiday-jp)[org_heigl/holidaychecker

Check for holidays - localeaware

843.4k](/packages/org-heigl-holidaychecker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
