Menu

Multiple recurrence rules

2015-08-15
2015-08-18
  • Peter Menhart

    Peter Menhart - 2015-08-15

    RFC 5545 allows multiple RRULEs in one VEVENT. However, VEvent.java allows only one rule (second call to setRecurrenceRule replaces the first). I am using addProperty as a workaround:

    for (recur: ...) event.addProperty(new RecurrenceRule(recur));

    Events are published (and interpreted by various clients) correctly.
    Note that I am using Biweekly only one-way, no experience with parsing external calendars.

    What are your thoughts about multiple RRULEs? Is there a better way how to handle them?

    Thanks
    Peter

     
  • Michael Angstadt

    Peter,

    I didn't create an "addRecurrenceRule" method because specs recommend against having more than one instance per component. But, as you discovered, if you really need more than one instance, you can use the "addProperty" method.

    RFC 5545 p.167:
    The "RRULE" property SHOULD NOT occur more than once in a component.

    Thank you,
    Mike

     
    • Peter Menhart

      Peter Menhart - 2015-08-17

      Hi Mike,

      Thanks for clarification, I overlooked this restriction.

      I have use cases with several occurrences in one day. I modeled them with multiple RRULE differing only in BYHOUR + BYMINUTE (if repeated with some frequency), or with RDATEs (if all occurrences are within the same day).

      Outlook does not support multiple RDATEs, but all clients accepted multiple RRULEs. Problem is none of them has a good user interface for multiple occurrences within a day, so I ended up spliting the events anyway: if there are 3 occurrences in a day, I publish 3 separate events now.

       
  • Michael Angstadt

    Thanks for the info Peter. It's really nice to know how people are using biweekly, and how well various clients support the iCal standard.

    Yes, it's perfectly valid to have multiple RRULEs. I just decided not to add a "addRecurrenceRule" method because the specs recommend against it.

     

Anonymous
Anonymous

Add attachments
Cancel