https://github.com/phptcloud/is-day-off
PHP SDK for isdayoff.ru
https://github.com/phptcloud/is-day-off
isdayoff php sdk
Last synced: over 1 year ago
JSON representation
PHP SDK for isdayoff.ru
- Host: GitHub
- URL: https://github.com/phptcloud/is-day-off
- Owner: PHPTCloud
- Created: 2020-10-18T21:27:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T23:28:03.000Z (over 2 years ago)
- Last Synced: 2025-02-27T16:47:21.315Z (over 1 year ago)
- Topics: isdayoff, php, sdk
- Language: PHP
- Homepage: https://isdayoff.ru/
- Size: 33.2 KB
- Stars: 26
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IsDayOf
[](https://packagist.org/packages/phptcloud/isdayoff-sdk)
[](https://packagist.org/packages/phptcloud/isdayoff-sdk)
[](https://github.com/PHPTCloud/IsDayOff/tree/master/examples)
PHP SDK for [isdayof.ru](https://isdayoff.ru)
#### Instalation
```bash
composer require phptcloud/isdayoff-sdk
```
#### After install
You can check the work of the scripts in the "Examples" folder. ;)
#### Simple example
```php
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
```php
// 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
```php
/**
* 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);
```