Cldr.DateTime.Formatter.standalone_quarter
You're seeing just the function
standalone_quarter
, go back to Cldr.DateTime.Formatter module for more information.
Specs
standalone_quarter(Calendar.date(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the standalone quarter
(format symbol a
) of a date
for given locale.
Arguments
date
is aDate
struct or any map that contains at least the keys:month
and:calendar
n
in an integer between 1 and 5 that determines the format of the quarterlocale
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 instandalone_quarter/5
Format Symbol
The representation of the quarter is made in accordance with the following table:
Symbol | Example | Cldr Format |
---|---|---|
q | 2 | Single digit |
"02" | Two digits | |
qqq | "Q2" | Abbreviated |
qqqq | "2nd quarter" | Wide |
qqqqq | "2" | Narrow |
Examples
iex> Cldr.DateTime.Formatter.standalone_quarter ~D[2019-06-08], 1
2
iex> Cldr.DateTime.Formatter.standalone_quarter ~D[2019-06-08], 2
"02"
iex> Cldr.DateTime.Formatter.standalone_quarter ~D[2019-06-08], 3
"Q2"
iex> Cldr.DateTime.Formatter.standalone_quarter ~D[2019-06-08], 4
"2nd quarter"
iex> Cldr.DateTime.Formatter.standalone_quarter ~D[2019-06-08], 5
"2"
Specs
standalone_quarter( Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t() ) :: String.t() | {:error, String.t()}