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

occurrences_between returns incorrect results if called with subseconds #89

Closed
adamilan opened this issue Jul 2, 2012 · 0 comments · Fixed by #130
Closed

occurrences_between returns incorrect results if called with subseconds #89

adamilan opened this issue Jul 2, 2012 · 0 comments · Fixed by #130
Labels

Comments

@adamilan
Copy link

adamilan commented Jul 2, 2012

sc = IceCube::Schedule.new(Time.gm(2012,4,1,10,00))
sc.add_recurrence_rule IceCube::Rule.weekly
d = sc.occurrences_between(Time.gm(2012,5,1,10,00),Time.gm(2012,5,15))[0].subsec <<< == 0 > ok

d = sc.occurrences_between(Time.gm(2012,5,1,10,00,00,4),Time.gm(2012,5,15))[0].subsec <<< == 1/250000 > NOT OK<<<<

This issue can cause very difficult to find bugs when comparing occurrence dates with other dates
To work around it, before calling occurrences_between with parameters, I make sure that theres no milliseconds
t = t - t.subsec

avit added a commit to avit/ice_cube that referenced this issue Dec 21, 2012
@avit avit closed this as completed in bc7ca3c Dec 21, 2012
rlivsey pushed a commit to rlivsey/ice_cube that referenced this issue Jun 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants