2017 © Pedro Peláez
 

library deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

image

bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  • Thursday, June 28, 2018
  • by bzarzuela
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Deadline Calculator with support for operating hours and holidays

Latest Version on Packagist Build Status Quality Score Total Downloads, (*1)

A very common requirement in our projects is the ability for the CRM to compute for the deadline of a Ticket. There are a lot of factors that have to be considered when computing deadlines such as weekends, operating hours that vary, etc, (*2)

By default, the package assumes a 24/7 operation. The recommended usage is to pre-configure the class and bind it to the Service Provider of your application., (*3)

Installation

You can install the package via composer:, (*4)

composer require bzarzuela/deadline-calculator

Usage

``` php $calculator = new Bzarzuela\DeadlineCalculator(); $calculator->startFrom('2018-06-28 12:20:00); $calculator->tatInDays(3); echo $calculator->deadline(); // 2018-07-01 12:20:00, (*5)


It supports bypassing weekends in the calculation. ``` php $calculator->noWeekends();

TAT can also be set in hours, (*6)

``` php $calculator->tatInHours(24);, (*7)


Operating Hours is supported for cases when TAT is measured in hours ``` php $calculator->tatInHours(24) ->operatingHours('09:00:00', '17:00:00'); // 9am to 5pm working hours

You can also set or override operating hours on a per-day basis ``` php $calculator->tatInHours(24) ->operatingHours('09:00:00', '17:00:00') // 9am to 5pm working hours ->saturday('09:00:00', '12:00:00') // Half day on Saturday ->noSunday(); // No work on Sundays, (*8)


### Testing ``` bash composer test

Changelog

Please see CHANGELOG for more information on what has changed recently., (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Security

If you discover any security related issues, please email bryan@teleserv.ph instead of using the issue tracker., (*11)

Credits

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

28/06 2018

dev-master

9999999-dev https://github.com/bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  Sources   Download

MIT

The Requires

 

The Development Requires

bzarzuela deadline-calculator

28/06 2018

v0.4

0.4.0.0 https://github.com/bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  Sources   Download

MIT

The Requires

 

The Development Requires

bzarzuela deadline-calculator

28/06 2018

v0.3

0.3.0.0 https://github.com/bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  Sources   Download

MIT

The Requires

 

The Development Requires

bzarzuela deadline-calculator

28/06 2018

v0.2

0.2.0.0 https://github.com/bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  Sources   Download

MIT

The Requires

 

The Development Requires

bzarzuela deadline-calculator

28/06 2018

v0.1.1

0.1.1.0 https://github.com/bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  Sources   Download

MIT

The Requires

 

The Development Requires

bzarzuela deadline-calculator

28/06 2018

v0.1

0.1.0.0 https://github.com/bzarzuela/deadline-calculator

Simplifies computation of TAT with overrides of operating hours and holidays

  Sources   Download

MIT

The Requires

 

The Development Requires

bzarzuela deadline-calculator