sourcepot/bankholidays
最新稳定版本:v2.2.0
Composer 安装命令:
composer require sourcepot/bankholidays
包简介
Bank holidays for the UK and Germany
关键字:
README 文档
README
The repository contains the PHP class SourcePot\BankHolidays\holidays which provides country and regions specific holidays as event-arrays. The country-specific bank holidays are derived from different sources such as the goverment (for the UK from Gov.uk) or calculated from rules.
Depending on the country, dates are derived from rules (such as for Germany) or a goverment internet resource is used (such as Gov.uk).
Note
The UK bank holidays are only available for a couple of years into the past and future.
You can install the www-project using composer: composer create-project sourcepot/bankholidays {target dir}
Just set your www-root directory to {target dir}/src/www/.
Code samples
The following code sample creates an instance of the holiday object for the year 2025 and country Germany. Method SourcePot\BankHolidays\holidays→getHolidays('Bavaria') is a holiday iterator, returning an holiday event with every iteration.
namespace SourcePot\BankHolidays;
require_once('../php/holidays.php');
$year=2025;
$country='de';
$holidayObj = new holidays($year,$country);
foreach($holidayObj->getHolidays('Bavaria') as $event){
var_dump($event);
}
Test web page
File ./www/index.php can be used to evaluate the respository.
统计信息
- 总下载量: 127
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-16
