Skip to content
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 parsing "today at noon" as tomorrow midnight - daylight saving related #389

Open
erikraudsepp opened this issue Mar 10, 2019 · 0 comments

Comments

@erikraudsepp
Copy link

On the day when we switched to daylight savings time, Chronic is parsing "today at noon" wrong.

(byebug) Time.current.middle_of_day
Sun, 10 Mar 2019 12:00:00 PDT -07:00
(byebug) Time.current
Sun, 10 Mar 2019 12:26:53 PDT -07:00
(byebug) Chronic.parse("today at noon")
Mon, 11 Mar 2019 00:00:00 PDT -07:00
(byebug) Chronic.parse("today")
Sun, 10 Mar 2019 18:30:00 PDT -07:00
(byebug) Chronic.parse("tomorrow")
Mon, 11 Mar 2019 13:00:00 PDT -07:00
(byebug) Chronic.parse("noon")
Mon, 11 Mar 2019 00:00:00 PDT -07:00
(byebug) Chronic.parse("6 in the morning")
Sun, 10 Mar 2019 06:00:00 PDT -07:00
(byebug) Chronic.parse("this morning")
Sun, 10 Mar 2019 10:00:00 PDT -07:00
(byebug) Chronic.parse("tomorrow at 6:45pm")
Mon, 11 Mar 2019 18:45:00 PDT -07:00
(byebug) Chronic.parse("afternoon yesterday")
Sat, 09 Mar 2019 15:00:00 PST -08:00
(byebug) Chronic.parse("afternoon today")
Sun, 10 Mar 2019 16:00:00 PDT -07:00
(byebug) Chronic.parse("afternoon tomorrow")
Mon, 11 Mar 2019 15:00:00 PDT -07:00
(byebug) Chronic.parse("at noon today")
*** RuntimeError Exception: 'at noon today' is not a recognized time expression

nil
(byebug) Chronic.parse("today at noon")
Mon, 11 Mar 2019 00:00:00 PDT -07:00
(byebug) Chronic.parse("today midnight")
Mon, 11 Mar 2019 00:00:00 PDT -07:00
(byebug) Chronic.parse("tomorrow midnight")
Tue, 12 Mar 2019 00:00:00 PDT -07:00

chronic (0.10.2)
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant