skanto / calendarevents
Calendar Event Repository (Get Holiday Dates like Easter, Advent etc.)
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-04-15 14:16:25 UTC
README
This is a very basic class that provides a list of christian holidays and calendar events from a given start date. The main purpose is to have a unified base for further calculations. The class is used to display or hide contents based on the event dates ("e.g. show this element 4 weeks before easter and hide it after easter monday is over.")
Usage
The Calendar Repository as of this writing only supports a getDates()
function that will return all configured Events.
More functions will follow when needed.
Example
use Skanto\CalendarEvents\CalendarEventRepository;
$relevancy = new CalendarEventRepository;
$dates = $relevancy
->setStartingDate('today')
->getDates();
header('content-type: text/plain');
var_dump($dates);
Testing
When contributing, please ensure you wrote a test case and the test case succeeds.
./phpunit --bootstrap src/CalendarEventRepository.php --testdox tests
Credits:
Thanks to http://www.die-seite.eu/ for sharing algorithms to calculate moon phases. Icon made by https://www.freepik.com/ from https://www.flaticon.com/ and is licensed by http://creativecommons.org/licenses/by/3.0/