japanese-holiday / japanese-holiday
Installs: 109 681
Dependents: 1
Suggesters: 0
Security: 0
Stars: 30
Watchers: 3
Forks: 4
Open Issues: 4
Requires
- symfony/yaml: ~2.5|~4.0
Requires (Dev)
- phpunit/phpunit: ~4.3
README
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