thiagomarini/not-tomorrow
Composer 安装命令:
composer require thiagomarini/not-tomorrow
包简介
PHP library to calculate the next working day. You can also check if a given date is a holiday or if the next day is on weekend.
README 文档
README
What for?
PHP library to calculate the next working day. Handy if you work with delivery only on weekdays.
You can also check if a given date is a holiday or if the next day is on weekend.
Requirements
- PHP >= 7.0
- Depends on easter_days()
Relies on handlers to work
Right now it can only calculate workdays for:
- England and Whales 🇬🇧
Feel free to contribute and send more handlers via pull requests. Handlers need to implement AnnualHolidays interface.
Basic Usage
<?php use NotTomorrow\Calendar; // Create a calendar class with a handler $calendar = new Calendar(new EnglandWhalesHolidays()); // Check if next day of a given date is on weekend $calendar->isNextDayOnWeekend(new \DateTime('2017-04-01')); // Check if a given date is a holiday $calendar->isHoliday(new \DateTime('2017-12-25')); //Find the next working day $calendar->findNextWorkingDay($friday);
License
MIT
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-03