adzap / timeliness

Fast date/time parsing for the control freak.
http://github.com/adzap/timeliness
MIT License
224 stars 27 forks source link

Change in how zeros are handled in month check #6

Closed gspiers closed 12 years ago

gspiers commented 12 years ago

This commit breaks how months with leading zeros are parsed. https://github.com/adzap/timeliness/commit/a3289d0e220075384691afd34cd2aaa8f40a11fe

Think the commit should be reverted. Thanks.

So month_index('09'):

month.to_i if month.to_i > 0 || /0+/ =~ month
9 (as an integer)

Integer(month) rescue ArgumentError
ArgumentError, which then tries to look up the month in the names hash but '09' isn't a valid index into that hash.
adzap commented 12 years ago

New release to fix this.