library business-day-finder
BusinessDay Finder
sadapon2008/business-day-finder
BusinessDay Finder
- Thursday, June 1, 2017
- by sadapon2008
- Repository
- 1 Watchers
- 0 Stars
- 232 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 1 % Grown
business-day-finder
Example
<?php
require_once('vendor/autoload.php');
use HolidayJp\HolidayJp; // k1low/holiday_jp
use BusinessDayFinder\Holiday;
use BusinessDayFinder\Finder;
$holidays = HolidayJp::between(new DateTime('2010-01-01'), new DateTime('2020-12-31'));
$holidaysForFinder = array();
foreach ($holidays as $holiday) {
$holidaysForFinder[] = new Holiday($holiday['date'], $holiday['name']);
}
$finder = new Finder();
$finder->addHolidayArray($holidaysForFinder);
$ret = $finder->getBusinessDayForward(new DateTime('2017-01-01'));
echo $ret->format('Y-m-d');