Cldr.DateTime.Formatter.era
You're seeing just the function
era, go back to Cldr.DateTime.Formatter module for more information.
Specs
era(Calendar.date(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the era (format symbol G) of a date
for given locale.
Arguments
dateis aDatestruct or any map that contains at least the keys:monthand:calendarnin an integer between 1 and 5 that determines the format of the yearlocaleis any valid locale name returned byCldr.known_locale_names/0or aCldr.LanguageTagstruct. The default isCldr.get_locale/0optionsis aKeywordlist of options. The only applicable option is:erawith a value of eithernil(the default) or:variantwhich will return the variant form of an era if one is available.
Format Symbol
The representation of the era is made in accordance with the following table:
| Symbol | Example | Cldr Format |
|---|---|---|
| G, GG, GGG | "AD" | Abbreviated |
| GGGG | "Anno Domini | Wide |
| GGGGG | "A" | Narrow |
Examples
iex> Cldr.DateTime.Formatter.era ~D[2017-12-01], 1
"AD"
iex> Cldr.DateTime.Formatter.era ~D[2017-12-01], 4, "fr", MyApp.Cldr
"après Jésus-Christ"
Specs
era(Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}