bank-holiday-germany-1.0.0.2: 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 covered by the ExtraHolidays module of this package.

Resources:

Synopsis

Documentation

data BankHoliday Source #

Data type specifying German bank holidays including Christmas Eve and New Year's Eve.

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

Constructors

NewYearsDay

Neujahrstag

GoodFriday

Karfreitag

EasterMonday

Ostermontag

LabourDay

Tag der Arbeit

AscensionDay

Christi Himmelfahrt

WhitMonday

Pfingstmontag

GermanUnityDay

Tag der Deutschen Einheit

ChristmasEve

Heilig Abend

ChristmasDay

1​. Weihnachtsfeiertag

SecondChristmasDay

2​. Weihnachtsfeiertag

NewYearsEve

Silvestertag

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.

yearFromDay :: Day -> Year Source #

Helper to extract the year from a date.

>>> yearFromDay $ fromGregorian 2020 1 1
2020