method

prev_occurring

Importance_1
v6.1.7.7 - Show latest stable - 0 notes - Class: Calculations
prev_occurring(day_of_week) public

Returns a new date/time representing the previous occurrence of the specified day of week.

today = Date.today               # => Thu, 14 Dec 2017
today.prev_occurring(:monday)    # => Mon, 11 Dec 2017
today.prev_occurring(:thursday)  # => Thu, 07 Dec 2017
Show source
Register or log in to add new notes.