PHPackages                             diego-brocanelli/calculate-working-days - 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. diego-brocanelli/calculate-working-days

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

diego-brocanelli/calculate-working-days
=======================================

Responsible for calculating working days between a date range

1.0.0(7y ago)75MITPHP &gt;=7.2

Since Jun 11Compare

[ Source](https://github.com/Diego-Brocanelli/calculate-working-days)[ Packagist](https://packagist.org/packages/diego-brocanelli/calculate-working-days)[ RSS](/packages/diego-brocanelli-calculate-working-days/feed)WikiDiscussions Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Calculate Working Days
======================

[](#calculate-working-days)

Calculate number of working days in a date range

[![Maintainability](https://camo.githubusercontent.com/52d4329d85f4a6e63339fa95114842dfadb3cd8b9ceab3106844d4a479ee2685/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65623539303130366666386632356133353830662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/Diego-Brocanelli/calculate-working-days/maintainability)

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Composer

Instalation
-----------

[](#instalation)

```
composer install
```

Tests
-----

[](#tests)

```
composer tests
```

Code Analysis
-------------

[](#code-analysis)

The command below will run PHPStan level 4 analysis.

```
composer code-analysis
```

Examples
--------

[](#examples)

#### A simple interval

[](#a-simple-interval)

```
$days = (new WorkingDays('2019-06-06', '2019-06-11'))->calculate();

$days->getNumber(); //output: 04
$days->getDayList(); //output: ['2019-06-06', '2019-06-07', '2019-06-10', '2019-06-11']
```

#### with holidays list

[](#with-holidays-list)

```
$holidays = ['2019-06-06'];

$days = (new WorkingDays('2019-06-05', '2019-06-11', $holidays))->calculate();

$days->getNumber(); //output: 04
$days->getDayList(); //output: ['2019-06-05', '2019-06-07', '2019-06-10', '2019-06-11']
```

Author
------

[](#author)

[Diego Brocanelli Francisco](http://www.diegobrocanelli.com.br/)

License
-------

[](#license)

[MIT](https://github.com/Diego-Brocanelli/calculate-working-days/blob/master/LICENSE)

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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

Unknown

Total

1

Last Release

2576d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57b7127885cf87740982db9b8b11bd7b6c7e4144cf86aec4c2eb1195db25120e?d=identicon)[Diego-Brocanelli](/maintainers/Diego-Brocanelli)

---

Top Contributors

[![Diego-Brocanelli](https://avatars.githubusercontent.com/u/4108889?v=4)](https://github.com/Diego-Brocanelli "Diego-Brocanelli (12 commits)")[![diego-brocanelli-bnw](https://avatars.githubusercontent.com/u/42388827?v=4)](https://github.com/diego-brocanelli-bnw "diego-brocanelli-bnw (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/diego-brocanelli-calculate-working-days/health.svg)

```
[![Health](https://phpackages.com/badges/diego-brocanelli-calculate-working-days/health.svg)](https://phpackages.com/packages/diego-brocanelli-calculate-working-days)
```

###  Alternatives

[fakerphp/faker

Faker is a PHP library that generates fake data for you.

4.0k379.0M4.3k](/packages/fakerphp-faker)[szepeviktor/composer-envato

Composer plugin for Envato

3616.3k1](/packages/szepeviktor-composer-envato)

PHPackages © 2026

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