Cldr.DateTime.Format.date_formats
You're seeing just the function
date_formats
, go back to Cldr.DateTime.Format module for more information.
Link to this function
date_formats(locale \\ Cldr.get_locale(), calendar \\ Cldr.Calendar.default_cldr_calendar(), backend \\ Cldr.Date.default_backend())
View SourceSpecs
date_formats( Cldr.Locale.locale_name() | Cldr.LanguageTag.t(), Cldr.Calendar.calendar(), Cldr.backend() ) :: {:ok, standard_formats()} | {:error, {atom(), String.t()}}
Returns a map of the standard date formats for a given locale and calendar.
Arguments
locale
is any locale returned byCldr.known_locale_names/0
calendar
is any calendar returned byCldr.DateTime.Format.calendars_for/1
The default is:gregorian
Examples:
iex> Cldr.DateTime.Format.date_formats "en", :gregorian, MyApp.Cldr
{:ok, %Cldr.Date.Styles{
full: "EEEE, MMMM d, y",
long: "MMMM d, y",
medium: "MMM d, y",
short: "M/d/yy"
}}
iex> Cldr.DateTime.Format.date_formats "en", :buddhist, MyApp.Cldr
{:ok, %Cldr.Date.Styles{
full: "EEEE, MMMM d, y G",
long: "MMMM d, y G",
medium: "MMM d, y G",
short: "M/d/y GGGGG"
}}