Date Utils
, (*1)
Utility for days and date spans, (*2)
Installation
Install via composer, (*3)
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, (*4)
Under BSD-3-Clause license, read LICENSE file., (*5)