timeliness icon indicating copy to clipboard operation
timeliness copied to clipboard

leap year

Open rfrohl opened this issue 12 years ago • 1 comments

Hi, fitting for this day we found a bug concerning the leap year. See the following example:

Timeliness.parse('2012', :format => 'yyyy', :strict => true) 2012-02-29 00:00:00 +0100

Timeliness.parse('2008', :format => 'yyyy', :strict => true) 2008-02-29 00:00:00 +0100

Timeliness.parse('2009', :format => 'yyyy', :strict => true) nil

Timeliness.parse('2010', :format => 'yyyy', :strict => true) nil Timeliness.parse('2011-02', :format => 'yyyy-mm', :strict => true) nil

Maybe Timeliness could check for this(29.02.) and return something like 28. 02. instead.

Regards, Robert

rfrohl avatar Feb 29 '12 12:02 rfrohl

Oh damn, a leap year bug. I think advancing to March 1 would probably be the way to go. Need to think about it I guess.

adzap avatar Mar 01 '12 02:03 adzap