seejohnrun/ice_cube — Issue #70: differences between occurrences, and occurrences_between
Author: mitchellbryson
Created: 2012-02-26 16:09:00+00:00
State: open

This works as expected, by missing out the exception date...

schedule = IceCube::Schedule.new(Time.now.beginning_of_day)
schedule.add_recurrence_rule(IceCube::Rule.daily)
schedule.add_exception_date(Time.now.beginning_of_day + 1.day)
=> 2012-02-27 00:00:00 +0000
schedule.occurrences(Time.now + 6.days)
=> [2012-02-26 00:00:00 +0000, 2012-02-28 00:00:00 +0000, 2012-02-29 00:00:00 +0000, 2012-03-01 00:00:00 +0000, 2012-03-02 00:00:00 +0000, 2012-03-03 00:00:00 +0000]

but using occurrences_between still shows the exception date...

schedule.occurrences_between(Time.now, Time.now + 6.days)
=> [2012-02-27 00:00:00 +0000, 2012-02-28 00:00:00 +0000, 2012-02-29 00:00:00 +0000, 2012-03-01 00:00:00 +0000, 2012-03-02 00:00:00 +0000, 2012-03-03 00:00:00 +0000]