ice_cube icon indicating copy to clipboard operation
ice_cube copied to clipboard

Exception rules using .until or .count limiting recurrence rules

Open Alan-M-Thomaz opened this issue 6 years ago • 0 comments

Using until or count in exception rules seens to limiting recurrence rules too.

date = Date.new.change({year: 2019})
rrule = IceCube::Schedule.new(date.change({ month: 2,  day:1}))
rrule.add_recurrence_rule IceCube::Rule.monthly.day_of_week(:tuesday => [1, -1], :wednesday => [2])
rrule.add_exception_rule IceCube::Rule.monthly.day_of_week(:tuesday => [1]).until( Date.today.change({ month:3, day:1}))
rrule.first(10)

results in [2019-02-13 00:00:00 -0200, 2019-02-26 00:00:00 -0300]

Alan-M-Thomaz avatar Feb 01 '19 16:02 Alan-M-Thomaz