ministryofjustice/date-utils

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (1.2.2) of this package.

Utility classes for working day and bank holiday calculations

1.2.2 2020-09-24 15:04 UTC

README

This repository is archived and no longer maintained. Instead, we recommend using Carbon with the business-day mixin which supports all of the functionality of the date-utils library, but with a better API.

Date Utils

Build Status

Scrutinizer Code Quality Code Coverage Build Status

Allows for the easy calculation of working days between two points. Automatically generates UK bank holidays, these can be overridden via config

Basic example

$date = WorkingDays::workingDaysFrom(new \DateTime('2014-01-01'), 1);

//$date will be set to 2014-01-02 which is the next working day

Tests

Build container so we can run PHP 5.4

docker-compose --project-name moj-date-utils build test

Run unit tests

docker-compose --project-name moj-date-utils run test