bank-holiday-germany-1.3.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.

The example prints all public holidays in Bavaria (Landkreis Miesbach, Oberbayern) in 2025:

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 2025 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
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:

Extra holidays are implemented for all 16 federal states. For some states, we couldn't find official sources; That's why this list only includes some states.

Synopsis

Documentation

data ExtraHoliday Source #

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

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

Constructors

HeiligeDreiKoenige

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

Fronleichnam

Fronleichnam (Bayern, Baden-Württemberg, Nordrhein-Westfalen, Hessen, Rheinland-Pfalz, Thüringen*, Saarland)

Friedensfest

Friedensfest (Bayern*)

MariaeHimmelfahrt

Mariä Himmelfahrt (Bayern*, Saarland)

Allerheiligen

Allerheiligen (Bayern, Baden-Württemberg, Nordrhein-Westfalen, Rheinland-Pfalz, Saarland)

Reformationstag

Reformationstag (Niedersachsen, Sachsen, Schleswig-Holstein, Brandenburg, Sachsen-Anhalt, Thüringen, Hamburg, Mecklenburg-Vorpommern, Bremen)

InternationalerFrauentag

Internationaler Frauentag (Berlin, Mecklenburg-Vorpommern)

BussUndBettag

Buß- und Bettag (Sachsen)

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.

Note: Internationaler Frauentag is a holiday in Berlin (since 2019) and Mecklenburg-Vorpommern (since 2023). However this function doesn't take the year into account and hence is incorrect for earlier years.

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