Cldr.DateTime.Formatter.quarter

You're seeing just the function quarter, go back to Cldr.DateTime.Formatter module for more information.
Link to this function

quarter(quarter, n \\ 1, options \\ [])

View Source

Specs

quarter(Calendar.date(), integer(), Keyword.t()) ::
  String.t() | {:error, String.t()}

Returns the quarter (format symbol Q) of a date for given locale.

Arguments

Format Symbol

The representation of the quarter is made in accordance with the following table:

SymbolExampleCldr Format
Q2Single digit
QQ"02"Two digits
QQQ"Q2"Abbreviated
QQQQ"2nd quarter"Wide
QQQQQ"2"Narrow

Examples

iex> Cldr.DateTime.Formatter.quarter ~D[2017-04-01], 1
2

iex> Cldr.DateTime.Formatter.quarter ~D[2017-04-01], 2
"02"

iex> Cldr.DateTime.Formatter.quarter ~D[2017-04-01], 3
"Q2"

iex> Cldr.DateTime.Formatter.quarter ~D[2017-04-01], 4
"2nd quarter"

iex> Cldr.DateTime.Formatter.quarter ~D[2017-04-01], 5
"2"
Link to this function

quarter(date, n, locale, backend, options \\ [])

View Source

Specs

quarter(Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t()) ::
  String.t() | {:error, String.t()}