Cldr.Calendar.Kday.last_kday
You're seeing just the function
last_kday
, go back to Cldr.Calendar.Kday module for more information.
Specs
last_kday(Calendar.day() | Date.t(), Cldr.Calendar.day_of_week()) :: Calendar.day() | Date.t()
Return the date of the last day_of_week
on or before the
specified date
.
Arguments
date
is%Date{}
, a%DateTime{}
,%NaiveDateTime{}
or a Rata Diek
is an integer day of the week.
Returns
- A
%Date{}
in the calendar of the date provided as an argument
Example
# Memorial Day in the US
iex> Cldr.Calendar.Kday.last_kday(~D[2017-05-31], 1)
~D[2017-05-29]