GithubHelp home page GithubHelp logo

japanese.holiday's Introduction

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

japanese.holiday's People

Contributors

77web avatar iamyukihiro avatar kohe avatar sunbear0226 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

japanese.holiday's Issues

複数の定義に対応

現在、祝日定義は単一となっているが、実際の祝日定義は国民の祝日に関する法律の改正などにより、年によって異なっている。
そこで、複数の祝日定義を持ち、各定義の適用年を考慮して利用する定義を決めたうえで、祝日生成ができるように変更したい。

Allow Symfony5

maybe dependency for symfony/yaml should be ^2|^3|^4|^5

vendor name

vendor名はjapaneseより個人名とかパッケージ名と同じにしてはどうでしょうか?
'nanaweb/japanese-holiday'とか、japanese-holiday/japanese-holiday等です。

2021年の山の日が誤っている

2021年の山の日は8/8ですが、 2021.yml では 2021-08-11 と定義されている(2022年の値)為、誤った挙動を行っているようです。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.