Given an input of, for example,
day = 'Monday'
how can I calculate the date of the next day?
day
def date_of_next(day) ... end
For stuff like this I rely on the chronic library.
The Ruby code would be:
def date_of_next(day) Chronic.parse("next #{day}") end