swydmuch / business-days
PHP library to work with single day and range of days in order to check business days
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/swydmuch/business-days
Requires
- php: >=8.0
Requires (Dev)
- infection/infection: ^0.25.5
- phpmd/phpmd: ^2.11
- phpstan/phpstan: ^1.2
- phpstan/phpstan-strict-rules: ^1.1
- phpunit/phpunit: ^9
This package is not auto-updated.
Last update: 2025-10-04 09:47:49 UTC
README
PHP library to work with single day and range of days in order to check business days
Installation
composer require swydmuch/business-days
Localization
At the moment, the library operates only on the public holidays in Poland (pl) and Netherlands (nl)
I encourage you to contribute in order to add other locations
Basic Usage
Creating Day from string
$day = Day::createFromString('2021-12-13', 'pl');
Checking if day is business
$day->isBusiness(); //true
Creating range between two days
$range = Range::createFromString('2021-12-13', '2021-12-14', 'pl');
Counting business days in range
$range->countBusinessDays(); //2
Getting array of business days from range
$range->businessDays(); //[Day,Day]