Cldr.Calendar.calendar_from_locale

You're seeing just the function calendar_from_locale, go back to Cldr.Calendar module for more information.
Link to this function

calendar_from_locale(locale)

View Source

Return the calendar module for a locale.

Arguments

  • :locale is any locale or locale name validated by Cldr.validate_locale/2. The default is Cldr.get_locale() which returns the locale set for the current process

Returns

  • {:ok, calendar_module} or

  • {:error, {exception, reason}}

Examples

iex> Cldr.Calendar.calendar_from_locale "en-US"
{:ok, Cldr.Calendar.US}

iex> Cldr.Calendar.calendar_from_locale "en-GB-u-ca-gregory"
{:ok, Cldr.Calendar.GB}

iex> Cldr.Calendar.calendar_from_locale "fa-IR"
{:ok, Cldr.Calendar.Persian}

iex> Cldr.Calendar.calendar_from_locale "fa-IR-u-ca-gregory"
{:ok, Cldr.Calendar.IR}
Link to this function

calendar_from_locale(locale, backend \\ Cldr.default_backend!())

View Source