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.
1.0.1
2017-04-04 14:00 UTC
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2025-05-21 21:04:50 UTC
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