Cldr.Calendar.first_gregorian_day_of_year
You're seeing just the function
first_gregorian_day_of_year
, go back to Cldr.Calendar module for more information.
Specs
first_gregorian_day_of_year(Calendar.year(), calendar()) :: Date.t() | {:error, :invalid_date}
Returns the gregorian date of the first day of of a year
for a calendar
.
Arguments
year
is any integer year numbercalendar
is any module that implements theCalendar
andCldr.Calendar
behaviours orCalendar.ISO
Examples
iex> Cldr.Calendar.first_gregorian_day_of_year 2019, Cldr.Calendar.Gregorian
%Date{calendar: Cldr.Calendar.Gregorian, day: 1, month: 1, year: 2019}
iex> Cldr.Calendar.first_gregorian_day_of_year 2019, Cldr.Calendar.NRF
%Date{calendar: Cldr.Calendar.Gregorian, day: 3, month: 2, year: 2019}
iex> Cldr.Calendar.first_gregorian_day_of_year ~D[2019-12-01]
~D[2019-01-01]