View Source Holidex.Countries.Canada (Holidex v0.1.5)

Provides public holiday dates and observances for Canadian holidays. Each province and territory in Canada has the authority to establish its own holiday schedule and observance rules.

Summary

Types

@type year() :: 1900..2200

Functions

@spec holiday(String.t(), year()) ::
  {:ok, Holidex.NationalHoliday.t()} | {:error, String.t()}
@spec holidays(year()) :: [Holidex.NationalHoliday.t()]
Link to this function

holidays_by_region(year)

View Source
@spec region_codes() :: [atom()]
@spec regions() :: [map()]

Retrieves detailed information about all available regions.

This function returns a list of maps, each containing detailed information about a specific region, including its name, region type, and region code.

Returns

  • list(map()) - A list of maps, each representing a region with the following keys:
    • :name - The name of the region (string)
    • :region_type - The type of the region (atom, e.g., :province, :state)
    • :region_code - The code for the region (atom)

Examples

iex> Holidex.Countries.Canada.regions()
[
  %{name: "Alberta", region_type: :province, region_code: "ab"},
  %{name: "British Columbia", region_type: :province, region_code: "bc"},
  ...
]