### Get Supported Locales Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Returns a map of all supported locales, where keys are locale codes and values are locale names. ```Elixir locales() :: map() ``` -------------------------------- ### Get Current Language Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Returns the language currently set for translating holiday names. The return type is a string. ```Elixir get_language() :: String.t() ``` -------------------------------- ### Get Holidays Between Dates Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves all holidays for a given locale within a specified date range. Returns a tuple with either {:ok, holidays} on success or {:error, reason} on failure. ```Elixir between(locale_code(), Date.t(), Date.t(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()} ``` -------------------------------- ### Get Holidays on a Specific Date Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves all holidays for a given locale on a specific date. Returns a tuple with either {:ok, holidays} on success or {:error, reason} on failure. ```Elixir on(locale_code(), Date.t(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()} ``` -------------------------------- ### Get Holidays for a Year Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves all holidays for a given locale within a specific year. Returns a tuple with either {:ok, holidays} on success or {:error, reason} on failure. ```Elixir year(locale_code(), integer(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()} ``` -------------------------------- ### Get Regions for Locale Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves a list of regions associated with a given locale. Returns a tuple with either {:ok, regions} on success or {:error, reason} on failure. ```Elixir get_regions(locale_code()) :: {:ok, [String.t()]} | {:error, error_reasons()} ``` -------------------------------- ### locales/0 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Returns a map of all supported locales in the system. The map keys are locale codes and the values are the locale names. ```APIDOC ## locales/0 ### Description Returns a map of all the supported locales. ### Function Signature `locales() :: map() ### Returns - A map where keys are locale codes (atoms or binaries) and values are the names of the locales (strings). ``` -------------------------------- ### on/3 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves all holidays for a specified locale on a given date. It returns a tuple containing either an 'ok' status with a list of holidays or an 'error' status with a reason. ```APIDOC ## on/3 ### Description 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. ### Function Signature `on(locale_code(), Date.t(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()} ### Parameters - **locale**: The locale code for which to retrieve holidays. - **date**: The specific date for which to retrieve holidays. - **opts**: Optional attributes for filtering holidays. ``` -------------------------------- ### between/4 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves all holidays for a specified locale within a given date range. It returns a tuple containing either an 'ok' status with a list of holidays or an 'error' status with a reason. ```APIDOC ## between/4 ### Description 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. ### Function Signature `between(locale_code(), Date.t(), Date.t(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()} ### Parameters - **locale**: The locale code for which to retrieve holidays. - **start**: The start date of the range. - **finish**: The end date of the range. - **opts**: Optional attributes for filtering holidays. ``` -------------------------------- ### year/3 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves all holidays for a specified locale within a given year. It returns a tuple containing either an 'ok' status with a list of holidays or an 'error' status with a reason. ```APIDOC ## year/3 ### Description Returns all the holidays for the given year. If succeed returns a `{:ok, holidays}` tuple, otherwise returns a `{:error, reason}` tuple. ### Function Signature `year(locale_code(), integer(), Holidefs.Options.attrs()) :: {:ok, [Holidefs.Holiday.t()]} | {:error, error_reasons()} ### Parameters - **locale**: The locale code for which to retrieve holidays. - **year**: The year for which to retrieve holidays. - **opts**: Optional attributes for filtering holidays. ``` -------------------------------- ### get_language/0 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves the current language setting used for translating holiday names. ```APIDOC ## get_language/0 ### Description Returns the language to translate the holiday names to. ### Function Signature `get_language() :: String.t() ### Returns - The current language code as a string. ``` -------------------------------- ### set_language/1 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Sets the language to be used for translating holiday names. To use native language names, set the language to `:orig`. ```APIDOC ## set_language/1 ### Description Sets the language to translate the holiday names to. To use the native language names, you can set the language to `:orig`. ### Function Signature `set_language(atom() | String.t()) :: nil ### Parameters - **locale**: The language code (atom or string) to set for translations. Use `:orig` for native names. ``` -------------------------------- ### Error Reasons Type Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Defines the possible reasons for an error when interacting with Holidefs. ```Elixir error_reasons() :: :no_def | :invalid_date ``` -------------------------------- ### get_regions/1 Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Retrieves a list of regions associated with a given locale. It returns a tuple containing either an 'ok' status with a list of regions or an 'error' status with a reason. ```APIDOC ## get_regions/1 ### Description Returns the list of regions from the given locale. If succeed returns a `{:ok, regions}` tuple, otherwise returns a `{:error, reason}` tuple. ### Function Signature `get_regions(locale_code()) :: {:ok, [String.t()]} | {:error, error_reasons()} ### Parameters - **locale**: The locale code for which to retrieve regions. ### Returns - A tuple `{:ok, regions}` on success, where `regions` is a list of strings. - A tuple `{:error, reason}` on failure, where `reason` is an `error_reasons()`. ``` -------------------------------- ### Locale Code Type Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Defines the type for a locale code, which can be an atom or a binary string. ```Elixir locale_code() :: atom() | binary() ``` -------------------------------- ### Set Translation Language Source: https://hexdocs.pm/holidefs/0.4.0/Holidefs.html Sets the language used for translating holiday names. Accepts an atom or string. Use :orig to set the original language. ```Elixir set_language(atom() | String.t()) :: nil ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.