japanese/holiday

This package is abandoned and no longer maintained. The author suggests using the japanese-holiday/japanese-holiday package instead.

v2.0.8 2020-12-21 00:35 UTC

This package is auto-updated.

Last update: 2020-12-21 00:36:32 UTC


README

Build Status

Japanese.Holiday

calculates holidays in Japan.

Installation

composer install japanese-holiday/japanese-holiday

Usage

Get list of holidays for a year

<?php
use Japanese\Holiday\Repository as HolidayRepository;

$holidayRepository = new HolidayRepository();
$holidays = $holidayRepository->getHolidaysForYear(2017);
$holidays['2017-01-01']->getDate(); // equals new \DateTime('2016-01-01')
$holidays['2017-01-01']->getName(); // "元旦"

Check whether a date is a holiday or not

<?php
use Japanese\Holiday\Repository as HolidayRepository;

$holidayRepository = new HolidayRepository();
$holidayRepository->isHoliday('2017-01-01'); // true
$holidayRepository->isHoliday('2017-01-04'); // false

Build new yml for a specific year

php scripts/newyear.php XXXX