def prev_occurring(day_of_week)
      ago = wday - DAYS_INTO_WEEK.fetch(day_of_week)
      ago += 7 unless ago > 0
      advance(days: -ago)
    end
def prev_occurring(day_of_week)
      ago = wday - DAYS_INTO_WEEK.fetch(day_of_week)
      ago += 7 unless ago > 0
      advance(days: -ago)
    end
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