twix/carbon
Composer 安装命令:
composer require twix/carbon
包简介
This is a wrapper for briannesbitt/carbon which also calculates which days are French bank holidays.
README 文档
README
Carbon Support for FR Bank Holidays
This extends Carbon and calculates which days are French bank holidays.
Note: For now, it only supports Carbon v2
Read this in other languages: Français
Installation
composer require twix/carbon
Examples
// Checks if the given date is bank holiday Carbon::isBankHoliday('2020-05-21'); // true Carbon::isBankHoliday(Carbon::parse('First day of 2000')); // true Carbon::getEasterMonday(2021); // '2021-04-05' Carbon::getWhitMonday(2021); // '2021-05-24' // Without any parameter will return date for the current year Carbon::getAscensionThursday(); // '2020-05-21' // Get all bank holidays for one year array_map(function (Carbon $carbon): string { return $carbon->format('Y-m-d'); }, Carbon::getAllBankHolidaysForOneYear(2021)); /* [ '2021-01-01', '2021-04-05', '2021-05-01', '2021-05-08', '2021-05-13', '2021-05-24', '2021-07-14', '2021-08-15', '2021-11-01', '2021-11-11', '2021-12-25' ] */
Contributing
- Clone the repo and install dependencies.
docker-compose run --rm php /usr/local/bin/composer install
- Run Tests
docker-compose run --rm php vendor/bin/phpunit
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-20