ministryofjustice / date-utils
Utility classes for working day and bank holiday calculations
Installs: 49 354
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 73
Forks: 4
Open Issues: 3
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is not auto-updated.
Last update: 2021-09-18 00:04:57 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
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