PHPackages                             bzarzuela/deadline-calculator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bzarzuela/deadline-calculator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bzarzuela/deadline-calculator
=============================

Simplifies computation of TAT with overrides of operating hours and holidays

v0.4(7y ago)04151[2 PRs](https://github.com/bzarzuela/deadline-calculator/pulls)MITPHPPHP ^7.1

Since Jun 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bzarzuela/deadline-calculator)[ Packagist](https://packagist.org/packages/bzarzuela/deadline-calculator)[ Docs](https://github.com/bzarzuela/deadline-calculator)[ RSS](/packages/bzarzuela-deadline-calculator/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

Deadline Calculator with support for operating hours and holidays
=================================================================

[](#deadline-calculator-with-support-for-operating-hours-and-holidays)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cc4af75f483aad752c9925a5a85142e67fbf6f9c451aa8e96ab6a24014bef562/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f627a61727a75656c612f646561646c696e652d63616c63756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bzarzuela/deadline-calculator)[![Build Status](https://camo.githubusercontent.com/6f524b5bb07fd0753deeafb024855dc8ba82095705e79eeace91c1bc4b4f4f1a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f627a61727a75656c612f646561646c696e652d63616c63756c61746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/bzarzuela/deadline-calculator)[![Quality Score](https://camo.githubusercontent.com/546f77341fefc3d0a0756be37485cc9889ae3297029070e8f7aaf74510ac9467/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f627a61727a75656c612f646561646c696e652d63616c63756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bzarzuela/deadline-calculator)[![Total Downloads](https://camo.githubusercontent.com/c979eaf09b53efd0760d12dcf5355bc700953b09e88a3d084d65c23098ebb3a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f627a61727a75656c612f646561646c696e652d63616c63756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bzarzuela/deadline-calculator)

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

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.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require bzarzuela/deadline-calculator
```

Usage
-----

[](#usage)

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

It supports bypassing weekends in the calculation.

```
$calculator->noWeekends();
```

TAT can also be set in hours

```
$calculator->tatInHours(24);
```

Operating Hours is supported for cases when TAT is measured in hours

```
$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

```
$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
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Bryan Zarzuela](https://github.com/bzarzuela)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

2875d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38ccdece52217bd76389a892ab153ef30ccbff5cbddb2c4b90754370b6b2694d?d=identicon)[bzarzuela](/maintainers/bzarzuela)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (69 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (13 commits)")[![bryanzarzuela](https://avatars.githubusercontent.com/u/39159496?v=4)](https://github.com/bryanzarzuela "bryanzarzuela (12 commits)")[![willemvb](https://avatars.githubusercontent.com/u/1336390?v=4)](https://github.com/willemvb "willemvb (3 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (2 commits)")[![gizburdt](https://avatars.githubusercontent.com/u/1470623?v=4)](https://github.com/gizburdt "gizburdt (2 commits)")[![sixlive](https://avatars.githubusercontent.com/u/5108034?v=4)](https://github.com/sixlive "sixlive (2 commits)")[![kapersoft](https://avatars.githubusercontent.com/u/13007854?v=4)](https://github.com/kapersoft "kapersoft (1 commits)")[![chapeupreto](https://avatars.githubusercontent.com/u/834048?v=4)](https://github.com/chapeupreto "chapeupreto (1 commits)")[![strebl](https://avatars.githubusercontent.com/u/6151204?v=4)](https://github.com/strebl "strebl (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")

---

Tags

bzarzueladeadline-calculator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bzarzuela-deadline-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/bzarzuela-deadline-calculator/health.svg)](https://phpackages.com/packages/bzarzuela-deadline-calculator)
```

###  Alternatives

[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
