Skip to content

PHP standalone library to manipulate business days

License

Notifications You must be signed in to change notification settings

natitech/businesscal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Businesscal

Build Status Latest Stable Version License

PHP standalone library to manipulate business days

Installation

composer require nati/businesscal

Version 6.x is compatible with PHP 7.4 and PHP 8.0 but is not maintained anymore. Version 7.x is compatible with PHP 8.1+ and is the current maintained version.

Usage

//You can pick up a holiday calendar from Nati\Businesscal\Holidays namespace or create your own implementing Nati\Businesscal\Holidays\HolidaysCalendar
$calendar = new Nati\Businesscal\BusinessCalendar(new FrHolidaysCalendar);

//To know if a given date is a business day
$calendar->isBusinessDay(new \DateTimeImmutable());

//To add some business days to a given date
$calendar->addNbBusinessDaysTo(new \DateTimeImmutable(), 20);