clippings / date-utils
日期范围实用工具
0.4.0
2020-02-18 08:28 UTC
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-09-18 18:17:17 UTC
README
日期和日期范围实用工具
安装
通过 composer 安装
composer require clippings/date-utils
使用方法
$span = new DaysSpan(new Days(20), new Days(40)); $start = new DateTime('today'); $dates = $span->toDateTimeSpan($start); echo $dates->humanize(); // For week days $span = new WeekDaysSpan(new WeekDays(20), new WeekDays(40)); $start = new DateTime('today'); $dates = $span->toDateTimeSpan($start); // For business with support of lists of holidays $holidays = new Holidays([ new DateTime('<Holiday 1>'), new DateTime('<Holiday 2>'), ]); $span = new BusinessDaysSpan(new BusinessDays(20, $holidays), new BusinessDays(40, $holidays)); $start = new DateTime('today'); $dates = $span->toDateTimeSpan($start);
许可协议
版权 (c) 2015, Clippings Ltd. 由 Ivan Kerin 开发
在 BSD-3-Clause 许可协议下,请参阅 LICENSE 文件。