iamfredric/holidays-se
Introduction
A package for dealing with Swedish holidays and day before holidays.
Requirements
- PHP ^8.1 or ^8.0
Installation
Install via composer
composer require iamfredric/holidays-se
Usage
use Iamfredric\Holidays\Day;
$day = new Day(\Carbon\Carbon::now());
// Check if day is a red day, returns true or false
$day->isRed();
// Check if day is a holiday, returns true or false
$day->isHoliday();
// Check if day is the day before a red day, returns true or false
$day->isDayBeforeRedDay();
// Check if day is easter, returns true or false
$day->isEaster();
// Check if day is day after Easter, returns true or false
$day->isDayAfterEaster(): bool
// Check if day is pentecost, returns true or false
$day->isPingstDay(): bool
// Gets some information about the day
$day->toArray();
[
'date' => 'Y-m-d',
'red' => true|false,
'day_before_red' => true|false,
'holiday' => true|false
]
Changelog
License
This package is open-sourced software licensed under the MIT license.