Cldr.Calendar.calendar_from_locale
You're seeing just the function
calendar_from_locale
, go back to Cldr.Calendar module for more information.
Return the calendar module for a locale.
Arguments
:locale
is any locale or locale name validated byCldr.validate_locale/2
. The default isCldr.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}