feat: add workdays endpoint

Added support for our new workdays endpoint that allows you to get the
number of working days for a country between two dates.
This commit is contained in:
Josh Sherman 2021-06-10 23:11:35 -05:00
parent c12f512f8a
commit 95bba75265
5 changed files with 172 additions and 15 deletions

View file

@ -8,19 +8,6 @@
Official PHP library for [Holiday API](https://holidayapi.com) providing quick
and easy access to holiday information from applications written in PHP.
## Migrating from 1.x
Please note, version 2.x of this library is a full rewrite of the 1.x series.
The interfacing to the library has been simplified and existing applications
upgrading to 2.x will need to be updated.
| Version 1.x Syntax (Old) | Version 2.x Syntax (New) |
|--------------------------------------------|-----------------------------------------------------------|
| `$holiday_api = new \HolidayAPI\v1($key);` | `$holiday_api = new \HolidayAPI\Client(['key' => $key]);` |
Version 1.x of the library can still be found
[here](https://github.com/joshtronic/php-holidayapi).
## Documentation
Full documentation of the Holiday API endpoints is available
@ -265,3 +252,16 @@ $holiday_api->workday([
'days' => 7,
]);
```
### Workdays
#### Fetch number of workdays between two dates
```php
<?php
$holiday_api->workdays([
'country' => 'US',
'start' => '2019-07-01',
'end' => '2019-07-10',
]);
```