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

Bug(s): Relative time with "at" #298

Open
areyes-ut opened this issue Mar 18, 2015 · 2 comments
Open

Bug(s): Relative time with "at" #298

areyes-ut opened this issue Mar 18, 2015 · 2 comments

Comments

@areyes-ut
Copy link

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 
@areyes-ut
Copy link
Author

chronic version 0.10.2

@DannyBen
Copy link

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.

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

No branches or pull requests

3 participants