ice-cube-ruby / ice_cube

Ruby Date Recurrence Library - Allows easy creation of recurrence rules and fast querying
MIT License
2.41k stars 358 forks source link

iCal parsing doesn't process multiple rules #303

Closed sethdeckard closed 7 years ago

sethdeckard commented 9 years ago

iCal parsing is only handling the last rule processed, example:

schedule = IceCube::Schedule.new
schedule.add_recurrence_rule IceCube::Rule.weekly.day(:monday, :tuesday)
schedule.add_recurrence_rule IceCube::Rule.weekly(2).day(:friday)

cal = schedule.to_ical
=> "DTSTART;TZID=CDT:20151005T195541\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU\nRRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU;BYDAY=FR"

parsed = IceCube::Schedule.from_ical(cal)
parsed.recurrence_rules.size
=> 1

cal2 = parsed.to_ical
=> "DTSTART;TZID=CDT:20151005T195541\nRRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU;BYDAY=FR"
Morantron commented 9 years ago

:+1: just jumped into this issue

dimerman commented 9 years ago

:+1:

dimerman commented 9 years ago

I have this https://github.com/seejohnrun/ice_cube/pull/308 for your consideration.