This is a bit of an edge case and I'm not sure how to account for it given ice_cube's current state.
schedule = IceCube::Schedule.new(t0 = Time.local(2016, 5, 1))
schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_month(15, -1).day(:monday, :tuesday, :wednesday, :thursday, :friday)
schedule.first(2).each { |occurrence| p occurrence.strftime('%A') }
The output:
"Tuesday"
"Wednesday"
=> [2016-05-31 00:00:00 -0500, 2016-06-15 00:00:00 -0500]
The current behavior skips any occurrence that falls on a weekend. This is expected. But would it be valuable to allow fallback occurrence rules? Maybe I would pass an existing occurrence to a fallback rule and add occurrences accordingly...
Thoughts?