Cldr.DateTime.Formatter.standalone_day_of_week
You're seeing just the function
standalone_day_of_week
, go back to Cldr.DateTime.Formatter module for more information.
Link to this function
standalone_day_of_week(standalone_day_of_week, n \\ 1, options \\ [])
View SourceSpecs
standalone_day_of_week(Calendar.date(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the stand-alone local day (format symbol c
)
of week number/name.
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 6 that determines the format of the day of weeklocale
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_day_of_week/4
Notes
This is the same as weekday_number/4
except that it is intended
for use without the associated d
format symbol.
Format Symbol
The representation of the time period is made in accordance with the following table:
Symbol | Example | Cldr Format |
---|---|---|
c, cc | 2 | Single digit |
ccc | "Tue" | Abbreviated |
cccc | "Tuesday" | Wide |
ccccc | "T" | Narrow |
cccccc | "Tu" | Short |
Examples
iex> Cldr.DateTime.Formatter.standalone_day_of_week ~D[2017-08-15], 3
"Tue"
iex> Cldr.DateTime.Formatter.standalone_day_of_week ~D[2017-08-15], 4
"Tuesday"
iex> Cldr.DateTime.Formatter.standalone_day_of_week ~D[2017-08-15], 5
"T"
iex> Cldr.DateTime.Formatter.standalone_day_of_week ~D[2017-08-15], 6
"Tu"
Specs
standalone_day_of_week( Calendar.date(), integer(), locale(), Cldr.backend(), Keyword.t() ) :: String.t() | {:error, String.t()}