Expand description
§feiertage
This crate provides functionality to calculate and verify German holidays.
Its main capabilities include:
-
Holiday Detection:
- Determine if a specific date is a holiday in a given German region.
- Supports all federal and regional holidays, including holidays specific to certain communities (e.g., Augsburg’s Friedensfest).
-
Region-Specific Calculation:
- The crate defines German regions (
Region) to handle region-specific holidays. - These include Catholic and Protestant variations where applicable.
- The crate defines German regions (
-
Holiday List:
- Provides a flexible way to retrieve region-specific holidays or nationwide holidays.
§Example
use feiertage::HolidayExt;
use feiertage::Region;
let date = time::Date::from_calendar_date(2023, time::Month::December, 25).unwrap();
// Returns true if the date is a holiday in the region of Bayern
assert!(date.is_holiday(Region::Bayern));Enums§
- Holiday
- All reoccurring holidays in Germany. This list contains both public and non-public holidays.
- Region
- The
Regionenum represents the different regions (mostly German states) for which holidays can be calculated. It includes variations for regions where religious or minor community-specific holidays differ.
Constants§
- NATION_
WIDE_ HOLIDAYS - A constant array of holidays that are observed nationwide.
Traits§
- Holiday
Ext - A trait that provides an extension method to check if a given date is a holiday within a specified region.