View Source Holidefs (holidefs v0.4.0)
Holidefs is a holiday OTP application for multiple locales that loads the dates from definition files on the startup.
Link to this section Summary
Functions
Returns all the holidays for the given locale between start and finish dates.
Returns the language to translate the holiday names to.
Returns the list of regions from the given locale.
Returns a map of all the supported locales.
Returns all the holidays for the given locale on the given date.
Sets the language to translate the holiday names to.
Returns all the holidays for the given year.
Link to this section Types
Specs
error_reasons() :: :no_def | :invalid_date
Specs
Link to this section Functions
Specs
between(locale_code(), Date.t(), Date.t(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()}
Returns all the holidays for the given locale between start and finish dates.
If succeed returns a {:ok, holidays}
tuple, otherwise
returns a {:error, reason}
tuple
Specs
get_language() :: String.t()
Returns the language to translate the holiday names to.
Specs
get_regions(locale_code()) :: {:ok, [String.t()]} | {:error, error_reasons()}
Returns the list of regions from the given locale.
If succeed returns a {:ok, regions}
tuple, otherwise
returns a {:error, reason}
tuple.
Specs
locales() :: map()
Returns a map of all the supported locales.
The key is the code and the value the name of the locale.
Specs
on(locale_code(), Date.t(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()}
Returns all the holidays for the given locale on the given date.
If succeed returns a {:ok, holidays}
tuple, otherwise
returns a {:error, reason}
tuple.
Specs
Sets the language to translate the holiday names to.
To use the native language names, you can set the language to :orig
Specs
year(locale_code(), integer(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()}
Returns all the holidays for the given year.
If succeed returns a {:ok, holidays}
tuple, otherwise
returns a {:error, reason}
tuple