PHPackages                             hashandsalt/kirby3-yasumi - 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. hashandsalt/kirby3-yasumi

ActiveKirby-plugin

hashandsalt/kirby3-yasumi
=========================

Kirby 3 - Yasumi

v1.0.0(6y ago)522MITPHP

Since Feb 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/HashandSalt/kirby3-yasumi)[ Packagist](https://packagist.org/packages/hashandsalt/kirby3-yasumi)[ RSS](/packages/hashandsalt-kirby3-yasumi/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

Kirby 3 Yasumi Plugin
=====================

[](#kirby-3-yasumi-plugin)

Get a list of official public holidays and the dates they fall on for any country and year. A wrapper around the [Yasumi](https://github.com/azuyalabs/yasumi) library, exposing it as a Kirby site method. Anything Yasumi can do, you should be able to chain in to the site method.

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

[](#installation)

### Manual

[](#manual)

To use this plugin, place all the files in `site/plugins/kirby3-yasumi`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/hashandsalt/kirby3-yasumi.git site/plugins/yasumi

```

### Composer

[](#composer)

```
composer require hashandsalt/kirby3-yasumi

```

---

Commerical Usage
----------------

[](#commerical-usage)

This plugin is free but if you use it in a commercial project please consider to

- [make a donation 🍻](https://paypal.me/hashandsalt?locale.x=en_GB) or
- [buy a Kirby license using this affiliate link](https://a.paddle.com/v2/click/1129/36141?link=1170)

---

Usage
-----

[](#usage)

Get all the holidays for the United States in 2020 - be warned, this is a huge array containing translations. If you literally just want the dates, keep reading.

```
$site->holidays('USA', 2020);
```

If you want it to keep rolling with the current year, use date()...

```
$site->holidays('Netherlands', date("Y"));
```

Just want the dates?
--------------------

[](#just-want-the-dates)

```
$holidays = $site->holidays('France', 2020);

$days = [];
foreach ($holidays->getHolidayDates() as $date) {
  $days[] = $date;
}

dump($days);
```

Advanced
--------

[](#advanced)

The example below uses Yasumi in combination with my [Recurr](https://github.com/HashandSalt/kirby-recurr) plugin to filter out repeating event dates that fall on public holidays. Thanks to [Bruno Meilick](https://github.com/bnomei) for the filter array code.

```
