Cldr.DateTime.Formatter.day_of_month
You're seeing just the function
day_of_month
, go back to Cldr.DateTime.Formatter module for more information.
Specs
day_of_month(Calendar.date(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the day of the month (symbol d
) as an integer.
Arguments
date
is aDate
struct or any map that contains at least the keys:year
,:month
,:day
and:calendar
n
in an integer between 1 and 2 that determines the format of the day of monthlocale
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 inday_of_month/4
Format Symbol
The representation of the day of the month is made in accordance
with the following table. Note that ddd
is not part of the CLDR
standard.
Symbol | Example | Cldr Format |
---|---|---|
d | 2, 22 | |
dd | 02, 22 | |
ddd | 2nd, 22nd |
Examples
iex> Cldr.DateTime.Formatter.day_of_month ~D[2017-01-04], 1
4
iex> Cldr.DateTime.Formatter.day_of_month ~D[2017-01-04], 2
"04"
iex> Cldr.DateTime.Formatter.day_of_month ~D[2017-01-04], 3
"4th"
Specs
day_of_month(Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}