1

I'm configuring recurring events with ice_cube gem and sometimes we need to configure an event with more than one rule. In those cases I only found how to store the count for each rule, but I need a 'global' count limit.

I tried this example: I want to schedule a recurrent event with this rules: weekly on Tuesday, and every other week on Wednesday.

This is the schedule commands I ran:

schedule = IceCube::Schedule.new
# weekly on Tuesday
schedule.add_recurrence_rule(IceCube::Rule.weekly.day(3).count(7))
# every other week on Wednesday
schedule.add_recurrence_rule(IceCube::Rule.weekly(2).day(4).count(7))

What I have until now is this:

:start_time: 2022-06-20 04:00:00.000000000 Z
:rrules:
- :validations:
    :day:
    - 1
    :hour_of_day:
    - 12
    :minute_of_hour:
    - 0
    :second_of_minute:
    - 0
  :rule_type: IceCube::WeeklyRule
  :interval: 1
  :week_start: 0
  :count: 7
- :validations:
    :day:
    - 2
    :hour_of_day:
    - 12
    :minute_of_hour:
    - 30
    :second_of_minute:
    - 0
  :rule_type: IceCube::WeeklyRule
  :interval: 2
  :week_start: 0
  :count: 7
:rtimes: []
:extimes: []

Each one of those rules has a count: 7 param, so I get 14 occurrences when using schedule.all_occurrences, but I want to have only 7 occurrences combining them. I don't find how to configure a global count limit.

Any idea? Thanks!

rogeryc
  • 23
  • 8

0 Answers0