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

This package is auto-updated.

Last update: 2025-05-21 21:04:50 UTC


README

CircleCI License: MIT

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

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