Search code examples
caldav

Expanding recurring events in CalDAV


Suppose a CalDAV client is really dumb (deeply embedded) and unable to calculate recurring events by itself. It is, however capable of putting in CalDAV requests. Suppose a CalDAV calendar has birthdays stored. One such birthday is on 2000-12-31. Now the client wants to receive all birthdays between 2005-05-05 and 2008-05-05.

The only way I can get Radicale to respond to such a request gives as an answer one entry, DTSTART = 2000-12-31 and the RRULE property set.

However, I would wish to receive three separate instances with dates 2005-12-31, 2006-12-31 and 2007-12-31. I tried to use "limit-recurrence-set" and "expand", but neither do what I describe. Is there a way in CalDAV to achieve what I explained?


Solution

  • This may be a limitation in Radicale, CalDAV itself does support recurrence expansion: RFC 4791 Section 7.8.3. The sample shown in the RFC:

    REPORT /bernard/work/ HTTP/1.1
    Host: cal.example.com
    Depth: 1
    Content-Type: application/xml; charset="utf-8"
    Content-Length: xxxx
    
    <?xml version="1.0" encoding="utf-8" ?>
    <C:calendar-query xmlns:D="DAV:"
                      xmlns:C="urn:ietf:params:xml:ns:caldav">
      <D:prop>
        <C:calendar-data>
          <C:expand start="20060103T000000Z"
                    end="20060105T000000Z"/>
        </C:calendar-data>
      </D:prop>
      <C:filter>
        <C:comp-filter name="VCALENDAR">
          <C:comp-filter name="VEVENT">
            <C:time-range start="20060103T000000Z"
                          end="20060105T000000Z"/>
          </C:comp-filter>
        </C:comp-filter>
      </C:filter>
    </C:calendar-query>