PHP code example of nuxia / business-day-manipulator
1. Go to this page and download the library: Download nuxia/business-day-manipulator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nuxia / business-day-manipulator example snippets
use Nuxia\BusinessDayManipulator\Manipulator;
$holidays = [
new DatePeriod(new \DateTime('2015-02-02'), new \DateTime('2015-02-06')),
new \DateTime('2015-02-20')
];
$freeDays = [
new DatePeriod(new \DateTime('2015-02-24'), new \DateTime('2015-02-27'))
];
$freeWeekDays = [
Manipulator::SATURDAY,
Manipulator::SUNDAY
];
$manipulator = new Manipulator($freeDays, $freeWeekDays, $holidays);
use Nuxia\BusinessDayManipulator\LocalizedManipulator;
$holidays = [
new DatePeriod(new \DateTime('2015-02-02'), new \DateTime('2015-02-06')),
new \DateTime('2015-02-20')
];
$freeDays = [
new DatePeriod(new \DateTime('2015-02-24'), new \DateTime('2015-02-27'))
];
$freeWeekDays = null; //If null, we will automatically set free week days from the locale.
//Guess automatically free week days.
$localizedManipulator = new LocalizedManipulator('Europe/Paris', 'fr', $freeDays, $freeWeekDay, $holidays);