fzed51/calendar-helper
Composer 安装命令:
composer require fzed51/calendar-helper
包简介
Function collections for working with a calendar.
README 文档
README
Function collections for working with a calendar.
Installation
composer require fzed51/calendar-helper
Use
Calendar
Is a bisextile year
\CalendarHelper\Calendar::isBisextile(2020); // => true \CalendarHelper\Calendar::isBisextile(new \DateTime('2020-06-15')); // => true \CalendarHelper\Calendar::isBisextile(2019); // => false
Returns bool.
Number of days in the month
\CalendarHelper\Calendar::numberOfDays(2020, 2); // => 29 \CalendarHelper\Calendar::numberOfDays(new \DateTime('2020-02-15')); // => 29 \CalendarHelper\Calendar::numberOfDays(2019, 2); // => 28
Returns int.
Is a holiday
\CalendarHelper\Calendar::isHolidays(2020, 7, 14); // => true (Bastille Day) \CalendarHelper\Calendar::isHolidays(new \DateTime('2020-07-14')); // => true \CalendarHelper\Calendar::isHolidays(2020, 7, 15); // => false
Returns bool.
List the holidays of a year
\CalendarHelper\Calendar::holidaysList(2020); // => [ // DateTimeImmutable('2020-01-01'), // New Year's Day // DateTimeImmutable('2020-04-13'), // Easter Monday // DateTimeImmutable('2020-05-01'), // May Day // DateTimeImmutable('2020-11-11'), // Armistice 1918 // DateTimeImmutable('2020-05-21'), // Ascension // DateTimeImmutable('2020-06-01'), // Whit Monday // DateTimeImmutable('2020-07-14'), // Bastille Day // DateTimeImmutable('2020-08-15'), // Assumption // DateTimeImmutable('2020-11-01'), // All Saints' Day // DateTimeImmutable('2020-05-08'), // Armistice 1945 // DateTimeImmutable('2020-12-25'), // Christmas Day // ]
Returns \DateTimeImmutable[].
Holiday
The Holiday class provides static methods to get the date of each French public holiday for a given year.
Each method accepts either an int year or a \DateTimeInterface object and returns a \DateTimeImmutable.
New Year's Day (1st January)
\CalendarHelper\Holiday::newYearsDay(2020); // => DateTimeImmutable('2020-01-01') \CalendarHelper\Holiday::newYearsDay(new \DateTime('2020-06-15')); // => DateTimeImmutable('2020-01-01')
Easter Sunday
\CalendarHelper\Holiday::easterDay(2020); // => DateTimeImmutable('2020-04-12')
Easter Monday
\CalendarHelper\Holiday::easterMonday(2020); // => DateTimeImmutable('2020-04-13')
May Day / Labour Day (1st May)
\CalendarHelper\Holiday::mayDay(2020); // => DateTimeImmutable('2020-05-01')
Armistice 1945 / Victory in Europe Day (8th May)
\CalendarHelper\Holiday::armisticeDe1945(2020); // => DateTimeImmutable('2020-05-08')
Ascension (39 days after Easter)
\CalendarHelper\Holiday::ascension(2020); // => DateTimeImmutable('2020-05-21')
Pentecost / Whit Sunday (49 days after Easter)
\CalendarHelper\Holiday::pentecote(2020); // => DateTimeImmutable('2020-05-31')
Whit Monday / Lundi de Pentecôte (50 days after Easter)
\CalendarHelper\Holiday::lundiDePentecote(2020); // => DateTimeImmutable('2020-06-01')
Bastille Day (14th July)
\CalendarHelper\Holiday::bastilleDay(2020); // => DateTimeImmutable('2020-07-14')
Assumption (15th August)
\CalendarHelper\Holiday::assomption(2020); // => DateTimeImmutable('2020-08-15')
All Saints' Day / Toussaint (1st November)
\CalendarHelper\Holiday::tousSaint(2020); // => DateTimeImmutable('2020-11-01')
Armistice 1918 (11th November)
\CalendarHelper\Holiday::armisticeDe1918(2020); // => DateTimeImmutable('2020-11-11')
Christmas Day (25th December)
\CalendarHelper\Holiday::christmasDay(2020); // => DateTimeImmutable('2020-12-25')
fzed51/calendar-helper 适用场景与选型建议
fzed51/calendar-helper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fzed51/calendar-helper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fzed51/calendar-helper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-19