Given a Ruby date, does a one liner exist for calculating the next anniversary of that date?
For example, if the date is May 01, 2011 the next anniversary would be May 01, 2012, however if it is December 01, 2011, the next anniversary is December 01, 2011 (as that date hasn’t yet arrived).
An excellent gem exists for doing this called recurrence. You can checkout the source code or some samples:
For example, if you have a
dateset you could try: