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

Inconsistent results when parsing different time conventions (12-hour vs 24-hour clock) #325

Open pawelkrol opened 8 years ago

pawelkrol commented 8 years ago

There is a strange behaviour observed when parsing plain times using chronic gem:

It seems a bit inconsistent to me, please see the following example:

2.1.5 :001 > require 'chronic'
 => true 
2.1.5 :002 > Chronic.parse("08:00AM")
 => 2016-02-24 08:00:00 +0100 
2.1.5 :003 > Chronic.parse("08:00")
 => 2016-02-25 08:00:00 +0100 

It has been confirmed with 0.9.1 and 0.10.2 releases, as well as the latest master branch.

davispuh commented 8 years ago

yeah, it's a bug, it's fixed in my rewrite branch but that's not ready yet and will be released as next major version.

pawelkrol commented 8 years ago

Thanks a lot for your confirmation. I am looking forward to a new release version containing this fix.