Cldr.DateTime.Formatter.week_of_month
You're seeing just the function
week_of_month
, go back to Cldr.DateTime.Formatter module for more information.
Specs
week_of_month(Calendar.date(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the week of the month (format symbol W
) 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 that should be between 1 and 4 that determines the format of the week of the 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 inweek_of_month/4
Format Symbol
The representation of the week of the month is made in accordance with the following table:
Symbol | Example | Cldr Format |
---|---|---|
W | 2 |
Examples
iex> import Cldr.Calendar.Sigils
Cldr.Calendar.Sigils
iex> Cldr.DateTime.Formatter.week_of_month ~D[2019-01-07], 1
"2"
iex> Cldr.DateTime.Formatter.week_of_month ~d[2019-W04-1], 1
"4"
Specs
week_of_month(Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}