chronic
chronic copied to clipboard
Bug(s): Relative time with "at"
2.1.5 :016 > Chronic.parse "2 days ago at 00:30"
=> 2015-03-17 00:30:00 -0700
2.1.5 :017 > Chronic.parse "2 days ago at 12:30"
=> 2015-03-17 00:30:00 -0700
2.1.5 :018 > Chronic.parse "12 hours before yesterday at 12:30"
=> 2015-03-16 12:30:00 -0700
2.1.5 :019 > Chronic.parse "12 hours before yesterday at 00:30"
=> 2015-03-16 12:30:00 -0700
2.1.5 :020 > Chronic.parse "12 hours before yesterday at 12:30am"
=> 2015-03-16 12:30:00 -0700
2.1.5 :021 > Chronic.parse "12 hours before yesterday at 12:30pm"
=> 2015-03-17 00:30:00 -0700
chronic version 0.10.2
Any chance of this bug being fixed soon?
when adding "at" time, the day gets one extra day...
>> Chronic.parse "1 days ago"
=> 2016-01-20 13:50:40 +0000
>> Chronic.parse "1 days ago at 00:01"
=> 2016-01-21 00:01:00 +0000
This was very obvious in one case where I am taking a user input for "how many days ago" and "from now" and returning dates, like this:
>> Chronic.parse "0 days ago at 00:01"
=> 2016-01-22 00:01:00 +0000
>> Chronic.parse "0 days from now at 23:59"
=> 2016-01-21 23:59:00 +0000
I expected the above to be the range of "today" of course.