week_of_year, go back to Cldr.DateTime.Formatter module for more information.
Returns the week of the year (symbol
w) as an integer.
Datestruct or any map that contains at least the keys
nin an integer between 1 and 2 that determines the format of the week of the year
Determining the week of the year is influenced by two factors:
The calendar in use. For example the ISO calendar (which is the default calendar in Elixir) follows the ISO standard in which the first week of the year is the week containing the first thursday of the year.
The territory in use. For example, in the US the first week of the year is the week containing January 1st whereas many territories follow the ISO standard.
The representation of the day of the year is made in accordance with the following table:
iex> import Cldr.Calendar.Sigils Cldr.Calendar.Sigils iex> Cldr.DateTime.Formatter.week_of_year ~D[2019-01-07], 1 "2" iex> Cldr.DateTime.Formatter.week_of_year ~d[2019-W04-1], 2 "04"