Crate feiertage

Crate feiertage 

Source
Expand description

§feiertage

This crate provides functionality to calculate and verify German holidays.

Its main capabilities include:

  1. 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).
  2. Region-Specific Calculation:

    • The crate defines German regions (Region) to handle region-specific holidays.
    • These include Catholic and Protestant variations where applicable.
  3. 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 Region enum 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§

HolidayExt
A trait that provides an extension method to check if a given date is a holiday within a specified region.