bank-holiday-germany-1.0.0.0: German bank holidays and public holidays
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Time.Calendar.BankHoliday.Germany

Description

This module computes general bank holidays. Most of these bank holidays are also public aka legal holidays throughout Germany. You can use isPublicHoliday to check if a holiday is also a legal holiday.

Note: There are even more public holidays in each federal state which are not covered by this module.

https://de.wikipedia.org/wiki/Bankfeiertag

Synopsis

Documentation

data BankHoliday Source #

Data type specifying German bank holidays.

Note: This type cannot be an instance of class Ord because due to Easter day calculation the order can change from year to year.

isBankHoliday :: Day -> Bool Source #

Check if a given day is a BankHoliday.

>>> isBankHoliday (fromGregorian 2024 1 1)
True

isPublicHoliday :: BankHoliday -> Bool Source #

True only for German public holidays aka legal holidays. Chrismas Eve and New Year's Eve are bank holidays but not public holidays.

calculateEasterSunday :: Year -> Day Source #

Calculate Easter Sunday using Spencer's algorithm.

holidaysBetween :: Day -> Day -> [(Day, BankHoliday)] Source #

Compute pairs of date and holiday from start to end.

>>> map snd $ holidaysBetween (fromGregorian 2024 12 25) (fromGregorian 2024 12 26)
[ChristmasDay,SecondChristmasDay]

fromDay :: Day -> Maybe BankHoliday Source #

Compute Maybe the holiday for a given date.

>>> fromDay (fromGregorian 2024 1 1)
Just NewYearsDay
>>> fromDay (fromGregorian 2024 5 5)
Nothing

toDay :: Year -> BankHoliday -> Day Source #

Compute the date for a given year and bank holiday.

>>> toDay 2024 LabourDay
2024-05-01

germanHolidayName :: BankHoliday -> String Source #

Translate the holiday name to German.