Flowdock
method

prev_occurring

Importance_1
Ruby on Rails latest stable (v5.2.3) - 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.