clippings / date-utils
Utility for date spans
Installs: 92 259
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 27
Forks: 0
Open Issues: 1
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-10-18 18:30:35 UTC
README
Utility for days and date spans
Installation
Install via composer
composer require clippings/date-utils
Usage
$span = new DaysSpan(new Days(20), new Days(40)); $start = new DateTime('today'); $dates = $span->toDateTimeSpan($start); echo $dates->humanize(); // For week days $span = new WeekDaysSpan(new WeekDays(20), new WeekDays(40)); $start = new DateTime('today'); $dates = $span->toDateTimeSpan($start); // For business with support of lists of holidays $holidays = new Holidays([ new DateTime('<Holiday 1>'), new DateTime('<Holiday 2>'), ]); $span = new BusinessDaysSpan(new BusinessDays(20, $holidays), new BusinessDays(40, $holidays)); $start = new DateTime('today'); $dates = $span->toDateTimeSpan($start);
License
Copyright (c) 2015, Clippings Ltd. Developed by Ivan Kerin
Under BSD-3-Clause license, read LICENSE file.