PHPackages                             h4kuna/workdays - 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. h4kuna/workdays

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

h4kuna/workdays
===============

v0.3.0(2y ago)04MITPHPPHP &gt;= 8.0CI failing

Since Aug 10Pushed 1y agoCompare

[ Source](https://github.com/h4kuna/workdays)[ Packagist](https://packagist.org/packages/h4kuna/workdays)[ Docs](https://github.com/h4kuna/workdays)[ Fund](https://revolut.me/milan2m/czk1000/library)[ GitHub Sponsors](https://github.com/h4kuna)[ RSS](/packages/h4kuna-workdays/feed)WikiDiscussions master Synced 1mo ago

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

[![Downloads this Month](https://camo.githubusercontent.com/510b54cc996f04b723efe5b031de66b49ba93a7c65acf69ad120a5b38df9acc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f68346b756e612f776f726b646179732e737667)](https://packagist.org/packages/h4kuna/workdays)[![Latest Stable Version](https://camo.githubusercontent.com/3df7eb14a969b291bf8961362dc7e3aa7affd8d934adf2dde0a14f6b37e5328a/68747470733a2f2f706f7365722e707567782e6f72672f68346b756e612f776f726b646179732f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/h4kuna/workdays)[![Coverage Status](https://camo.githubusercontent.com/3b543394163372cb5977486cb6d1cc336933484ebb25533bc6bce1caac3f402e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f68346b756e612f776f726b646179732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/h4kuna/workdays?branch=master)[![Total Downloads](https://camo.githubusercontent.com/1cdbf5d945053282a2e55a47a5ff6dd47b82fffa0edab629e714284ba5c775cc/68747470733a2f2f706f7365722e707567782e6f72672f68346b756e612f776f726b646179732f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/h4kuna/workdays)[![License](https://camo.githubusercontent.com/3b8d4904560e541817206faa3599a953a426a88f84b2a54c6eaae241a4a77270/68747470733a2f2f706f7365722e707567782e6f72672f68346b756e612f776f726b646179732f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/h4kuna/workdays)

Usage
-----

[](#usage)

```
use h4kuna\Workdays;
$builder = Workdays\Factory::create();

$workdays = $builder->get('cs_CZ');

$datetime = new DateTime('2016-01-04 12:46:28');

echo ($workdays->isHoliday($datetime) ? 'true' : 'false') . PHP_EOL;
// false

echo ($workdays->isWorkday($datetime) ? 'true' : 'false') . PHP_EOL;
// true

$nextHoliday = $workdays->nextHoliday($datetime);
echo $nextHoliday->name . PHP_EOL;
// Velký pátek
echo $nextHoliday->date->format('Y-m-d H:i:s') . PHP_EOL;
// 2016-03-25 00:00:00

echo $workdays->nextWorkday($datetime)->format('Y-m-d H:i:s') . PHP_EOL;
// 2016-01-05 12:46:28

$workdays->moveWorkdays($datetime, 7);
echo $datetime->format('Y-m-d H:i:s') . PHP_EOL;
// 2016-01-13 12:46:28

$workdays = $builder->get('sk_SK');
$datetime = new DateTime('2016-01-04 12:43:28');

echo ($workdays->isHoliday($datetime) ? 'true' : 'false') . PHP_EOL;
// false

echo ($workdays->isWorkday($datetime) ? 'true' : 'false') . PHP_EOL;
// true

$nextHoliday = $workdays->nextHoliday($datetime);
echo $nextHoliday->name . PHP_EOL;
// Zjavenie Pána
echo $nextHoliday->date->format('Y-m-d H:i:s') . PHP_EOL;
// 2016-01-06 00:00:00

echo $workdays->nextWorkday($datetime)->format('Y-m-d H:i:s') . PHP_EOL;
// 2016-01-05 12:43:28

$workdays->moveWorkdays($datetime, 7);
echo $datetime->format('Y-m-d H:i:s') . PHP_EOL;
// 2016-01-14 12:43:28
```

### Custom Holiday Providers

[](#custom-holiday-providers)

```
use h4kuna\Workdays;

$builder = Workdays\Factory::create();

class CustomHolidaysProvider implements Workdays\HolidaysProvider\BaseProvider
{
    protected function holidaysInYear(int $year): array {
        return [
            // fill dates
        ];
    }
}

$builder->addProvider('myProvider', new CustomHolidaysProvider());

// initialize workdays util without country code; the correct holidays provider is not yet available
$workdays = $builder->get('myProvider');
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 76.2% 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 ~521 days

Recently: every ~629 days

Total

6

Last Release

960d ago

PHP version history (2 changes)0.1.0PHP &gt;= 5.4.0

v0.3.0PHP &gt;= 8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/54b4efb9b89167fa3598b1a41477b20387390f4a0fb65b447bd6bb7c30a49020?d=identicon)[h4kuna](/maintainers/h4kuna)

---

Top Contributors

[![petaak](https://avatars.githubusercontent.com/u/8841381?v=4)](https://github.com/petaak "petaak (16 commits)")[![h4kuna](https://avatars.githubusercontent.com/u/335722?v=4)](https://github.com/h4kuna "h4kuna (2 commits)")[![PRGfx](https://avatars.githubusercontent.com/u/3868790?v=4)](https://github.com/PRGfx "PRGfx (1 commits)")[![sadekd](https://avatars.githubusercontent.com/u/6051891?v=4)](https://github.com/sadekd "sadekd (1 commits)")[![vallbo](https://avatars.githubusercontent.com/u/8950881?v=4)](https://github.com/vallbo "vallbo (1 commits)")

---

Tags

workdays

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/h4kuna-workdays/health.svg)

```
[![Health](https://phpackages.com/badges/h4kuna-workdays/health.svg)](https://phpackages.com/packages/h4kuna-workdays)
```

###  Alternatives

[thedudeguy/rcon

Simple Rcon class for php.

16259.4k1](/packages/thedudeguy-rcon)[h4kuna/number-format

Object wrapper above number\_format

1889.3k2](/packages/h4kuna-number-format)[padosoft/support

agnostic helpers to use as foundation in packages and other project

5117.0k5](/packages/padosoft-support)[moe/full-calendar

A lightweight calendar module for Silverstripe. Implements the popular javascript http://fullcalendar.io/ library.

121.5k](/packages/moe-full-calendar)

PHPackages © 2026

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