Cldr.DateTime.Formatter.hour_0_11
You're seeing just the function
hour_0_11
, go back to Cldr.DateTime.Formatter module for more information.
Specs
hour_0_11(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the formatting of the :hour
(format symbol K
) as a number in the
range 0..11 as a string.
Arguments
time
is aTime
struct or any map that contains at least the key:hour
n
is the number of digits to which:hour
is paddedlocale
is any valid locale name returned byCldr.known_locale_names/0
or aCldr.LanguageTag
struct. The default isCldr.get_locale/0
options
is aKeyword
list of options. There are no options used inhour_0_11/4
Format Symbol
The representation of the hour
is made in accordance with the following
table:
Symbol | Midn. | Morning | Noon | Afternoon | Midn. |
---|---|---|---|---|---|
K | 0 | 1...11 | 0 | 1...11 | 0 |
Examples
iex> Cldr.DateTime.Formatter.hour_0_11 %{hour: 0}
"0"
iex> Cldr.DateTime.Formatter.hour_0_11 %{hour: 12}
"0"
iex> Cldr.DateTime.Formatter.hour_0_11 %{hour: 24}
"0"
iex> Cldr.DateTime.Formatter.hour_0_11 %{hour: 23}
"11"
iex> Cldr.DateTime.Formatter.hour_0_11 %{hour: 11}
"11"
iex> Cldr.DateTime.Formatter.hour_0_11 %{hour: 9}
"9"
Specs
hour_0_11(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}