Cldr.Calendar.month_of_year

You're seeing just the function month_of_year, go back to Cldr.Calendar module for more information.

Specs

month_of_year(Date.t()) :: Calendar.month()

Returns the month number for a date.

Arguments

  • date is any Date.t()

Returns

  • a the quarter of the year as an integer

Examples

iex> Cldr.Calendar.month_of_year ~D[2019-01-01]
1
iex> Cldr.Calendar.month_of_year ~D[2019-12-01]
12
iex> Cldr.Calendar.month_of_year ~D[2019-52-01 Cldr.Calendar.NRF]
12
iex> Cldr.Calendar.month_of_year ~D[2019-26-01 Cldr.Calendar.NRF]
6