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

Data.Time.Calendar.BankHoliday.Germany.ExtraHolidays

Description

This module provides additional German public holidays that are not covered by the bank holidays.

Public holidays – except for GermanUnityDay – are under federal obligations in Germany („Ländersache“).

Most bank holidays are also federal public holidays (see isPublicHoliday). But there are some additional extra holidays which may differ between federal states.

For example, Heilige Drei Könige is not a bank holiday but it is a public holiday in Bavaria.

Note: The extra holidays are currently only implemented for Baden-Württemberg, Bayern, Berlin, Niedersachsen, Hessen, and Nordrhein-Westfalen.

Example for computing all public holidays in Bavaria (Landkreis Miesbach, Oberbayern) in the next couple years:

import Prelude
import Data.List
import Data.Time
import qualified Data.Time.Calendar.BankHoliday.Germany as BH
import qualified Data.Time.Calendar.BankHoliday.Germany.ExtraHolidays as EH

start = fromGregorian 2024 1 1

end = fromGregorian 2025 12 31

holidays :: [[String]]
holidays = map ((x,y) -> [show x, BH.germanHolidayName y]) (filter (BH.isPublicHoliday . snd) $ BH.holidaysBetween start end)
        ++ map ((x,y) -> [show x, EH.germanHolidayName y]) (filter ((/= EH.Friedensfest) . snd) $ EH.holidaysBetween EH.Bayern start end)

main :: IO ()
main = putStrLn $ unlines $ sort $ map unwords holidays
2024-01-01 Neujahrstag
2024-01-06 Heilige Drei Könige
2024-03-29 Karfreitag
2024-04-01 Ostermontag
2024-05-01 Tag der Arbeit
2024-05-09 Christi Himmelfahrt
2024-05-20 Pfingstmontag
2024-05-30 Fronleichnam
2024-08-15 Mariä Himmelfahrt
2024-10-03 Tag der Deutschen Einheit
2024-11-01 Allerheiligen
2024-12-25 1. Weihnachtsfeiertag
2024-12-26 2. Weihnachtsfeiertag
2025-01-01 Neujahrstag
2025-01-06 Heilige Drei Könige
2025-04-18 Karfreitag
2025-04-21 Ostermontag
2025-05-01 Tag der Arbeit
2025-05-29 Christi Himmelfahrt
2025-06-09 Pfingstmontag
2025-06-19 Fronleichnam
2025-08-15 Mariä Himmelfahrt
2025-10-03 Tag der Deutschen Einheit
2025-11-01 Allerheiligen
2025-12-25 1. Weihnachtsfeiertag
2025-12-26 2. Weihnachtsfeiertag

Resources:

Synopsis

Documentation

data ExtraHoliday Source #

Extra federal holidays, no overlap with BankHoliday. Spezielle Feiertage der Bundesländer.

Note: Currently, only some federal states' extra holidays are implemented. See module description above for details.

*regional holiday, only applies in parts of the federal state

Constructors

HeiligeDreiKoenige

Heilige Drei Könige (Bayern, Baden-Württemberg, …)

Fronleichnam

Fronleichnam (Bayern, Baden-Württemberg, Nordrhein-Westfalen, Hessen, …)

Friedensfest

Friedensfest (Bayern*, …)

MariaeHimmelfahrt

Mariä Himmelfahrt (Bayern*, …)

Allerheiligen

Allerheiligen (Bayern, Baden-Württemberg, Nordrhein-Westfalen, …)

Reformationstag

Reformationstag (Niedersachsen, …)

InternationalerFrauentag

Internationaler Frauentag (Berlin, …)

data FederalState Source #

Germany's federal states – Deutsche Bundesländer.

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

Compute pairs of date and holiday from start to end (inclusive) for the given federal state.

>>> map snd $ holidaysBetween Bayern (fromGregorian 2024 8 8) (fromGregorian 2024 8 15)
[Friedensfest,MariaeHimmelfahrt]

fromDay :: Day -> Maybe ExtraHoliday Source #

Compute Maybe the holiday for a given date.

Note: In some years, two extra holidays may fall on the same day. In such cases this function returns the holiday that is defined first in the ExtraHoliday Enum.

>>> fromDay (fromGregorian 2024 11 1)
Just Allerheiligen
>>> fromDay (fromGregorian 2024 5 5)
Nothing

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

Compute the date for a given year and extra holiday.

>>> toDay 2024 HeiligeDreiKoenige
2024-01-06

germanHolidayName :: ExtraHoliday -> String Source #

Translate the holiday name to German.

isHolidayInState :: FederalState -> ExtraHoliday -> Bool Source #

Check if ExtraHoliday is a holiday in the given federal state.

>>> isHolidayInState Bayern Allerheiligen
True
>>> isHolidayInState Berlin Allerheiligen
False