skanto / calendarevents
本包最新版本(dev-master)没有可用的许可证信息。
日历事件仓库(获取如复活节、圣诞等节假日日期)
dev-master
2023-12-15 11:11 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-15 12:42:09 UTC
README
这是一个非常基本的类,它提供了从给定起始日期开始的基督教节假日和日历事件的列表。主要目的是为了有一个统一的计算基础。该类用于根据事件日期显示或隐藏内容(例如,在复活节前4周显示此元素,复活节星期一过后隐藏)
用法
截至本文撰写时,日历仓库仅支持一个getDates()
函数,该函数将返回所有配置的事件。当需要时,将会有更多的功能。
示例
use Skanto\CalendarEvents\CalendarEventRepository;
$relevancy = new CalendarEventRepository;
$dates = $relevancy
->setStartingDate('today')
->getDates();
header('content-type: text/plain');
var_dump($dates);
测试
在贡献时,请确保你编写了测试用例,并且测试用例成功通过。
./phpunit --bootstrap src/CalendarEventRepository.php --testdox tests
致谢
感谢http://www.die-seite.eu/分享计算月相的算法。图标由https://www.freepik.com/提供,来自https://www.flaticon.com/,并受http://creativecommons.org/licenses/by/3.0/许可。