pub enum GermanState {
Show 17 variants
BW,
BY,
BE,
BB,
HB,
HH,
HE,
MV,
NI,
NW,
RP,
SL,
SN,
ST,
SH,
TH,
ANY,
}Expand description
Enum for all German states, plus a variant for holidays effective in any state. These implement HolidayCalendar
Variants§
BW
Baden-Württemberg
BY
Bayern
BE
Berlin
BB
Brandenburg
HB
Bremen
HH
Hamburg
HE
Hessen
MV
Mecklenburg-Vorpommern
NI
Niedersachsen
NW
Nordrhein-Westfalen
RP
Rheinland-Pfalz
SL
Saarland
SN
Sachsen
ST
Sachsen-Anhalt
SH
Schleswig-Holstein
TH
Thüringen
ANY
Checks for holidays in any state
Implementations§
Source§impl GermanState
impl GermanState
Trait Implementations§
Source§impl Clone for GermanState
impl Clone for GermanState
impl Copy for GermanState
Source§impl Debug for GermanState
impl Debug for GermanState
Source§impl<T: Datelike + Copy + PartialOrd> HolidayCalendar<T> for GermanState
This implementation doesn’t return any holidays before 1990.
impl<T: Datelike + Copy + PartialOrd> HolidayCalendar<T> for GermanState
This implementation doesn’t return any holidays before 1990.
Before that the current Germany was separated into the “German Democratic Republic” and the “Federal Republic of Germany” which both had somewhat different holidays. Since this class is called “Germany” it doesn’t really make sense to include the days from the two former countries.
Note that Germany doesn’t have rules for holidays that happen on a Sunday. Those holidays are still holiday days but there is no additional day to make up for the “lost” day.
Also note that German holidays are partly declared by each state there are some weired edge cases:
- Assumption Day / Mariä Himmelfahrt is only a holiday in Bavaria (BY) if your municipality is mostly catholic which in term depends on census data. Since we don’t have this data but most municipalities in Bavaria are mostly catholic, we count that as holiday for whole Bavaria.
- There is an Augsburg Peace Festival / Augsburger Friedensfest which only exists in the Bavarian town Augsburg. This is excluded for Bavaria.
- Maundy Thursday / Gründonnerstag (Thursday before easter) is not a holiday but pupils in Baden Württemberg (BW) don’t have to go to school. It is excluded from our list.
- Corpus Christi / Fronleichnam is a holiday in certain, explicitly defined municipalities in Saxony (SN) and Thuringia (TH). We exclude it from both provinces.
Source§fn is_holiday(&self, date: T) -> bool
fn is_holiday(&self, date: T) -> bool
true if date is a holiday.Source§fn is_bday(&self, date: T) -> bool
fn is_bday(&self, date: T) -> bool
true if date is a Business Day.
A Business Day is defined as a weekday that is not a holiday.Source§fn to_bday(&self, date: T, adjust_next: bool) -> T
fn to_bday(&self, date: T, adjust_next: bool) -> T
date to the last/next business day if it’s not a business day.Source§fn advance_bdays(&self, date: T, bdays_count: i32) -> T
fn advance_bdays(&self, date: T, bdays_count: i32) -> T
bdays_count number of business days from date.