Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

ministryofjustice/date-utils

Repository files navigation

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