MyApp.Cldr.calendar_from_locale

You're seeing just the function calendar_from_locale, go back to MyApp.Cldr 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> MyApp.Cldr.calendar_from_locale "en-GB"
{:ok, Cldr.Calendar.GB}

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

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

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