-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chronic parse broken #282
Comments
No idea, I can't reproduce, it works for me. Chronic.parse("today 23:30")
=> 2014-10-27 23:30:00 +0200
Chronic.parse("today 23:45")
=> 2014-10-27 23:45:00 +0200
Chronic.parse("today 23:59")
=> 2014-10-27 23:59:00 +0200 |
That's funny. The machine is running on CET timezone, Europe/Zurich. irb(main):018:0> Chronic.parse('today 23:00', :now => Time.local(2014, 10, 26, 16, 00, 00)) Funnily enough this happened only yesterday, between 23:01 and 23:59. Also: Quite a coincidence that this issue happened on the same day when we move away from DST. |
Not a coincidence, but bug in Chronic regarding DST. Same issue as #147, #177, #179, #222, #228 I just tested it with 26th and indeed I get nil, because here also DST changes on 26th (before I tried it on 27th). Anyway I didn't investigated exactly why, but it's not really important as I've started this rewrite #278 and on that branch it works fine (you get correct 23:01). But note that DST rollover still isn't implemented even there (Chronic have never supported that yet), but it's planned to be added later. So currently if you parse something like |
First of all - thanks for Chronic! This does not work:
Workaround:
Ruby 2.1.3 |
And a week later Chronic.parse('sunday last week') returns nil. |
Check this out.
root@host:~ # rpm -q rubygem-chronic
rubygem-chronic-0.10.2-1
root@host:~ # irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'chronic'
=> true
irb(main):003:0> t = Chronic.parse("today 21:00")
=> Sun Oct 26 21:00:00 +0100 2014
irb(main):004:0> t = Chronic.parse("today 22:00")
=> Sun Oct 26 22:00:00 +0100 2014
irb(main):005:0> t = Chronic.parse("today 23:00")
=> Sun Oct 26 23:00:00 +0100 2014
irb(main):006:0> t = Chronic.parse("today 23:30")
=> nil
irb(main):007:0> t = Chronic.parse("today 23:45")
=> nil
irb(main):008:0> t = Chronic.parse("today 23:59")
=> nil
irb(main):010:0> t = Chronic.parse("tomorrow 00:00")
=> Mon Oct 27 00:00:00 +0100 2014
irb(main):010:0>
Any idea?
M
The text was updated successfully, but these errors were encountered: