You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to use previous_occurrence() with a date that is 1ms in front of the first occurrence but it does not detect it. It's almost like previous_occurrence only finds occurrences that are at least 1 day behind. Is there a way to allow previous_occurrence to evaluate based on time rather than just date?
Below is an example showing how the first occurrence is due at 11:59pm on dec 31st but checking for previous occurrences from jan 1 doesn't find it.
schedule=IceCube::Schedule.new(Date.parse('01-01-2018').end_of_day - 1.day)do |s|
s.add_recurrence_rule(IceCube::Rule.monthly(6))endschedule.first# Sun, 31 Dec 2017 23:59:59 UTC +00:00schedule.previous_occurrence(Date.parse('01-01-2018'))# nil
The text was updated successfully, but these errors were encountered:
The smallest unit that IceCube works with is 1 second: milliseconds are dropped.
I think here because you are trying to jump from 00:00:00 to the previous occurrence at 23:59:59.99999, it's jumping back to 23:59:59 which is before the range of the schedule.
I think we are not normalizing the start time when we check that boundary: looks like an edge case.
I am attempting to use
previous_occurrence()
with a date that is 1ms in front of the first occurrence but it does not detect it. It's almost like previous_occurrence only finds occurrences that are at least 1 day behind. Is there a way to allowprevious_occurrence
to evaluate based on time rather than just date?Below is an example showing how the first occurrence is due at 11:59pm on dec 31st but checking for previous occurrences from jan 1 doesn't find it.
The text was updated successfully, but these errors were encountered: