jelmer / xandikos

A CalDAV/CardDAV server backed by Git
https://www.xandikos.org/
GNU General Public License v3.0
409 stars 42 forks source link

support recurring events #8

Open jelmer opened 7 years ago

jelmer commented 7 years ago

rrule et al

jansohn commented 5 years ago

Just found out that this is not supported... Would be great to have this feature!

EDIT: Somehow it seems to have worked the second time I tried. Is this already supported?

jelmer commented 5 years ago

You can create recurring events and retrieve them, but specific query commands (e.g. date range searches) will only return the recurring event if the first instance is covered by the date range.

tobixen commented 1 year ago

Any ideas on how to solve this? (I'm considering to migrate my personal calendar to Xandikos, this is probably the only blocker issue)

jelmer commented 1 year ago

We need to expand rrules:

You could probably use the code for CalDAV:expand in Xandikos/CalDAV.py as inspiration (potentially with some refactoring to share more oy the logic).

jelmer commented 1 year ago

I've done some work on this, and my draft branch does work but I'm not happy with it in its current form.

It currently expands ics files when generating indexes, which can be really expensive for events that don't have an end date.

The correct solution is to store RRULE, EXDATE, EXRULE, etc in indexes as well and then evaluate those against the specified timerange when filtering.

tobixen commented 1 year ago

I will test it

tobixen commented 1 year ago

My test code still fails on the expand part, but except for that even my pesky testTodoDatesearch passed.

I will try to come up with a trivial example of expected vs observed result on a query.

tobixen commented 1 year ago

Search query:

<C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <D:prop>
    <C:calendar-data>
      <C:expand start="20081101T160000Z" end="20081103T160000Z"/>
    </C:calendar-data>
  </D:prop>
  <C:filter>
    <C:comp-filter name="VCALENDAR">
      <C:comp-filter name="VEVENT">
        <C:time-range start="20081101T160000Z" end="20081103T160000Z"/>
      </C:comp-filter>
    </C:comp-filter>
  </C:filter>
</C:calendar-query>

event returned:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:19970901T130000Z-123403@example.com
DTSTART;VALUE=DATE:19971102
CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION
CLASS:CONFIDENTIAL
DTSTAMP:19970901T130000Z
RRULE:FREQ=YEARLY
SUMMARY:Our Blissful Anniversary
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR

The icalendar data returned is not expanded.

faan11 commented 7 months ago

any news about this issue?