Due date calculator written in PHP
This project is a due date calculator library written in PHP.
bin/ - executable files for Composer src/ - library source tests/ - Executable files for Composer
The program reads the currently reported problems (bugs) from an issue tracking system and calculates the due date following the rules below:
- Working hours can be specified. Defaults are 9AM to 5PM every working day (Monday through Friday)
- The program does not deal with holidays, which means that a holiday on a Thursday is still considered as a working day by the program. Also a working Saturday will still be considered as a nonworking day by the system.
- The turnaround time is given in working hours, which means for example that 2 days are 16 hours. As an example: if a problem was reported at 2:12PM on Tuesday then it is due by 2:12PM on Thursday.
- All submitted date values must be between working hours.
composer require shakahl/due-php
use Shakahl\Due\DueDateCalculator; $calculator = DueDateCalculator::make(); $calculator->setDayStart(9); $calculator->setDayEnd(17); $dueDate = $calculator->calculate('2018-05-11 11:23:42', 7); echo $dueDate->format('c'); // 2018-05-14T10:23:42+00:00
composer global require shakahl/due-php due calculate "2018-05-11 11:23:42" 7
$ composer test
The MIT License (MIT). Please see License File for more information.