Cldr.Calendar.Kday.last_kday

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

Specs

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 Die

  • k 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]