minasm/carbon-uk
最新稳定版本:1.0.1
Composer 安装命令:
composer require minasm/carbon-uk
包简介
A basic wrapper for citco/carbon which returns business days between two given dates.
README 文档
README
Minasm/Carbon is a package that extends the functionality of the citco/carbon package, which provides a wrapper for the Carbon date/time library with support for UK bank holidays.
Installation
To install Minasm/Carbon, simply require it using Composer:
composer require minasm/carbon-uk
Usage
Minasm/Carbon provides a single method: getBusinessDays(). This method calculates the number of business days between two dates, excluding weekends and UK bank holidays. Here's how you can use it:
use Minasm\Carbon;
$startDate = '01/03/2023';
$endDate = '31/03/2023';
$businessDays = (new Carbon())->getBusinessDays($startDate, $endDate);
echo "There are {$businessDays} business days between {$startDate} and {$endDate}";
The output of the above code will be:
There are 23 business days between 01/03/2023 and 31/03/2023.
The getBusinessDays() method takes three parameters:
$start(string): the start date, in the format specified by the$formatparameter (default is'd/m/Y').$end(string): the end date, in the format specified by the$formatparameter (default is'd/m/Y').$format(string, optional): the format of the$startand$endparameters (default is'd/m/Y').
Issues
If you encounter any bugs or have any feature requests, please submit them to the GitHub issue tracker.
License
Minasm/Carbon is open source software licensed under the MIT license.
统计信息
- 总下载量: 300
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-16