mojombo / chronic

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

Daylight savings messes with parsing "[x] weeks from [date] at [time] #366

Open bawolf opened 6 years ago

bawolf commented 6 years ago

Today is October 19th, 2017 and daylight savings is October 31st, 2017. I tried the following code:

> Chronic.parse('three weeks from monday at 9am')
2017-11-06 08:00:00 -0500

It seems to calculate "exactly three weeks" as in "724hrs2" from "Monday at 9am" which is actually 2017-11-06 08:00:00 -0500 because the day of daylight savings is 25 hours long. I would expect it to calculate "three weeks from Monday" as the date, and "9am" as the time.

To me it should return the same result as

> Chronic.parse('November 6th at 9am')
2017-11-06 09:00:00 -0500
davispuh commented 6 years ago

it's a known DST issue #344 but it's fixed in my rewrite branch #347 and works there fine.