phptcloud / isdayoff-sdk
PHP SDK for isdayof.ru
Installs: 26 027
Dependents: 1
Suggesters: 0
Security: 0
Stars: 26
Watchers: 1
Forks: 5
Open Issues: 0
Requires
- php: >=7.4
- fig/http-message-util: ^1.0
- guzzlehttp/guzzle: ^7.0
README
PHP SDK for isdayof.ru
Instalation
composer require phptcloud/isdayoff-sdk
After install
You can check the work of the scripts in the "Examples" folder. ;)
Simple example
require_once __DIR__ . '/../vendor/autoload.php'; use isDayOff\Client\IsDayOff; $client = new IsDayOff(); $date = new DateTime('now'); $result = $client->date()->isDayOff($date); if($result) { echo 'is day off.'; } else { echo 'working day.'; }
Filters
// Countries isDayOff\Filters\UkraineFilter isDayOff\Filters\RussianFilter isDayOff\Filters\KazakhstanFilter isDayOff\Filters\BelorusFilter isDayOff\Filters\UnitedStatesFilter isDayOff\Filters\UzbekistanFilter isDayOff\Filters\TurkeyFilter // Additional isDayOff\Filters\CovidFilter isDayOff\Filters\PreHolidayFilter
Filters examples
/** * New filter collection */ $filters = new FiltersCollection(); $filters->addOne(new UkraineFilter()); $client->date()->setFilters($filters); $date = new DateTime('2019/01/01'); $result = $client->date()->getDataPerMonth($date); print_r($result);