seebaermichi / monthly-calendar
一个提供根据给定月份和事件显示天数和事件的月历包。
1.3.0
2023-03-07 12:29 UTC
Requires
- php: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^1.20
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2024-09-09 21:00:09 UTC
README
此包返回一个简单的数组,其中包含月份、周和事件,这些月份、周和事件取决于您提供的内容。
安装
您可以通过composer安装此包
composer require seebaermichi/monthly-calendar
用法
// Will return an array with the given months and their weeks and days // weeks will start with Monday $monthlyCalendar = new Seebaermichi\MonthlyCalendar(['December 2021', 'January 2022']); $calendar = $monthlyCalendar->getCalendar(); // Will return an array with the given months and their weeks and days // weeks will start with Sunday $monthlyCalendar = new Seebaermichi\MonthlyCalendar(['February 1989', 'March 1989'], 'Sun'); $calendar = $monthlyCalendar->getCalendar(); // Provide simple array of events and event label to get related days labeled // First of December will have an event attribute 'birthday' $monthlyCalendar = new Seebaermichi\MonthlyCalendar(['December 2021']); $calendar = $monthlyCalendar->getCalendar(['2021-12-01'], 'birthday'); // Provide array of events with detailed data to get related days labeled // 6th of March 2023 will have an events array including the given data $monthlyCalendar = new Seebaermichi\MonthlyCalendar(['December 2021']); $givenEvents = [ [ 'datetime' => '2023-06-03 10:00', 'label' => 'meeting', ], [ 'datetime' => '2023-06-03 13:00', 'label' => 'lunch', ], ]; $calendar = $monthlyCalendar->getCalendar($givenEvents, '', 'Y-m-d H:i'); // Get only weekdays array with optional $startWith day $weekdays = Seebaermichi\MonthlyCalendar::weekdays(); // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] $weekdays = Seebaermichi\MonthlyCalendar::weekdays('Sun'); // ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
测试
composer test
变更日志
请参阅变更日志以获取最近更改的更多信息。
贡献
请参阅贡献指南以获取详细信息。
安全漏洞
请查阅我们的安全策略了解如何报告安全漏洞。
致谢
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。