mojombo / chronic

Chronic is a pure Ruby natural language date parser.
http://injekt.github.com/chronic
MIT License
3.24k stars 458 forks source link

Incorrect parsing of 'Aug 31sh 11:00pm' (typo: 31sh instead of 31st) #336

Closed ctrlrsf closed 5 years ago

ctrlrsf commented 8 years ago

When there's a typo in the day of the month such as '31sh' instead of '31st', the returned date is '2016-08-01'.

Would prefer if this returned an error because of the typo, or at least the number '31'.

$ irb
2.2.1 :001 > require 'chronic'
 => true
2.2.1 :002 > Chronic.parse 'Aug 31sh 11:00pm'
 => 2016-08-01 23:00:00 -0400

Related issue in whenever gem repo: https://github.com/javan/whenever/issues/652