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


Return the date of the nth day_of_week on or before/after the specified date.


  • date is %Date{}, a %DateTime{}, %NaiveDateTime{} or a Rata Die

  • n is the cardinal number of k before (negative n) or after (positive n) the specified date

  • k is an integer day of the week.


  • A %Date{} in the calendar of the date provided as an argument


# Thanksgiving in the US
iex> Cldr.Calendar.Kday.nth_kday(~D[2017-11-01], 4, 4)

# Labor day in the US
iex> Cldr.Calendar.Kday.nth_kday(~D[2017-09-01], 1, 1)

# Daylight savings time starts in the US
iex> Cldr.Calendar.Kday.nth_kday(~D[2017-03-01], 2, 7)