skanto/calendarevents

There is no license information available for the latest version (dev-master) of this package.

Calendar Event Repository (Get Holiday Dates like Easter, Advent etc.)

dev-master 2023-12-15 11:11 UTC

This package is auto-updated.

Last update: 2024-05-15 11:57:56 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/