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.
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/thiagomarini/not-tomorrow
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2025-10-21 21:59:16 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