Hey guys,
Every time I build a calendar system or anything with an annually recurring set of dates, I find myself doing this all the time to avoid getting invalid date exceptions:
year = Date.today.year
if (year % 4 != 0) && rhs.month == 2 && rhs.day == 29 rday = 28 else rday = rhs.day end
date = Date.new(year, rhs.month, rday)
Would anybody be interested in a patch so we could just do:
Date.new(year, rhs.month, rhs.day, :fix_leap_year => true)
Maybe even make :fix_leap_year => true the default behavior?
Thanks, Ryan