swydmuch/business-days

PHP library to work with single day and range of days in order to check business days

v1.0.2 2025-04-05 20:14 UTC

This package is not auto-updated.

Last update: 2025-09-20 09:37:42 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]