PHPackages                             codemonauts/craft-holidays - 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. codemonauts/craft-holidays

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

codemonauts/craft-holidays
==========================

Craft CMS plugin for international holidays.

2.0.0(4y ago)23.3k1MITPHP

Since Dec 24Pushed 4y ago2 watchersCompare

[ Source](https://github.com/codemonauts/craft-holidays)[ Packagist](https://packagist.org/packages/codemonauts/craft-holidays)[ RSS](/packages/codemonauts-craft-holidays/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

International holidays plugin for Craft CMS
===========================================

[](#international-holidays-plugin-for-craft-cms)

[![Icon](resources/holidays.png)](resources/holidays.png)

A plugin for Craft CMS that provides access to many international holidays.

This plugin is based on the awesome work of [yasumi](https://azuyalabs.github.io/yasumi/). Go and buy him a coffee!

Background
----------

[](#background)

This plugin provides easy access to holidays in many countries. For example to automatically determine if a shop or restaurant is open or closed on an official holiday in a country.

Coverage
--------

[](#coverage)

Currently 35 countries and 85 sub-regions:

Australia, Austria, Belgium, Bosnia &amp; Herzegovina, Brazil, Croatia, Czechia, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Russia, Slovakia, South Africa, South Korea, Spain, Sweden, Switzerland, United States, Ukraine and United Kingdom

For more details see [yasumi's feature page](https://azuyalabs.github.io/yasumi/features/). And if you are missing your country, why not contribute by adding a new provider for your country?

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

[](#requirements)

- Craft CMS &gt;= 4.0.0

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

[](#installation)

Open your terminal and go to your Craft project:

```
cd /path/to/project
composer require codemonauts/craft-holidays
./craft install/plugin holidays
```

Switch to the settings page in the control panel and enter select your default country and subregion.

Usage
-----

[](#usage)

You can query for holidays like for entries:

```

{% for holiday in craft.holidays.type('official').between('last monday', '2019-12-31').all() %}
{{ holiday.format('Y-m-d') }}: {{ holiday.getName() }}
{% endfor %}

```

or same in php:

```
use codemonauts\holidays\base\Holidays;

$holidays = Holidays::find()
    ->type('official')
    ->between('last monday', '2019-12-31')
    ->all();
```

### Filtering

[](#filtering)

You can combine the following filters in any order:

`type(typename)` specifies the type of holidays to return. Default is `Null`. Possible other types are:

- 'official'
- 'observance'
- 'season'
- 'bank'
- 'other'
- Null (means "all")

`country(code)` sets the country for which the holidays should be returned. The code is the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) code of the country and its subregion. You can set the default country in the settings.

`locale(code)` sets the locale code to translate the holidays names to. The default is set to your site locale in Craft CMS.

`year(year)` specifies for which year the holidays are returned. You can only get the holidays for one specific year. This is set automatically to the date set by `on()` or `between()`. Normally you do not need to specify anything here.

`on(date)` sets a single date to check for holidays. You can provide a DateTimeInterface or a date string like '2019-12-25' or a string that can be parsed by [strtotime](https://www.php.net/manual/en/datetime.formats.php).

`between(startDate, endDate)` filter for a time range. Same rules as for `on(date)`.

### Fetching

[](#fetching)

To fetch the results you have different functions:

`one()` returns the first holiday as an extended DateTime object (see results).

`all()` returns all holidays as array (actually an iterator) of extended DateTime objects.

`count()` returns the number of holidays found.

`isHoliday()` returns true or false if a holiday exists.

### Results

[](#results)

As result you get a DateTime object with the following extensions:

`getType()` returns the type of holiday.

`getName()` returns the translated name of the holiday. If for the given locale no translation is defined, the name in 'en\_US' is returned.

Examples
--------

[](#examples)

Get all holidays of a year:

```
craft.holidays.year(2019).all()
```

Get all official holidays of a time range:

```
craft.holidays.type('official').between(entry.postDate, '2019-12-31').all()
```

Check if today is a official holiday in Japan:

```
craft.holidays.type('official').on('now').country('JP').isHoliday()
```

Settings
--------

[](#settings)

You can set the default country and subregion in a config file placed in your CraftCMS config directory. You can find the most recent version in src/config.php. You have to name the file `holidays.php`.

```
return [
    // Default country code in ISO 3166-2 (https://en.wikipedia.org/wiki/ISO_3166-2) notation.
    // E.g. DE-HE, US-CA
    'defaultCode' => '',
];
```

If you do not set a default country code or the country code could not be found, we fall back to `US`.

With ❤ by [codemonauts](https://codemonauts.com)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~867 days

Total

2

Last Release

1469d ago

Major Versions

1.0.0 → 2.0.02022-05-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/539161?v=4)[codemonauts](/maintainers/codemonauts)[@codemonauts](https://github.com/codemonauts)

---

Top Contributors

[![kringkaste](https://avatars.githubusercontent.com/u/964698?v=4)](https://github.com/kringkaste "kringkaste (5 commits)")

---

Tags

cmsCraftcraftcmscraft-plugin

### Embed Badge

![Health badge](/badges/codemonauts-craft-holidays/health.svg)

```
[![Health](https://phpackages.com/badges/codemonauts-craft-holidays/health.svg)](https://phpackages.com/packages/codemonauts-craft-holidays)
```

###  Alternatives

[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[pennebaker/craft-architect

CraftCMS plugin to generate content models from JSON/YAML data.

72148.5k5](/packages/pennebaker-craft-architect)

PHPackages © 2026

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