feiertag
Types
Values
pub fn get_holiday(
country: Country,
year: Int,
month: Int,
day: Int,
) -> Result(String, Nil)
get the name of a holiday
Returns
Ok(name) -> given date is a state holiday in the given country and the holiday is called name
Error(Nil) -> given date is not a state holiday
Examples
assert Ok("Christtag") == get_holiday(Austria, 2025, 12, 25)
assert Ok("Stefanitag") == get_holiday(Austria, 2025, 12, 26)
assert Error(Nil) == get_holiday(Austria, 2025, 12, 20)
pub fn get_holidays(
country: Country,
year: Int,
) -> List(#(#(Int, Int, Int), String))
get all state holidays in a year for a country
Returns
[#(#(year, month, day), name), ..]
Examples
assert Ok(#(#(2025, 1, 1), "Neujahr"))
== get_holidays(Austria, 2025)
|> list.first()
pub fn is_holiday(
country: Country,
year: Int,
month: Int,
day: Int,
) -> Bool
checks if a given date is a state holiday in Country
Returns
True-> given date is a state holiday in the given countryFalse-> given date is not a state holiday in the given country
Examples
assert True == is_holiday(Austria, 2025, 12, 25)
assert False == is_holiday(Austria, 2025, 11, 20)