Problem with CalDav/Ical request with time-range filter

Hi,

is it possible to get only a few events from Kopano CalDav/Ical Server with a time-range filter?
I always get every event that exists in the calendar - a lot of items.

<?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/>
    <D:getetag/>
  </D:prop>  <C:filter>
    <C:comp-filter name="VCALENDAR">
      <C:comp-filter name="VEVENT">
        <C:time-range start="20180901T000000Z" end="20180930T240000Z"/>
      </C:comp-filter>
    </C:comp-filter>
  </C:filter>
</C:calendar-query>

Thank you very much,
Norman

This post is deleted!
This post is deleted!

And here are the results of the german vote…

Now I have installed the new CalDav implementation on Kopano version 8.3.0 (not supported).

The result is much better! Now with the query (first post) I get all events in this time range, but also the repeating events. I don’t know why - but for me it’s ok, because I can filter this ones in a second step.

To the background: I need this functionality for my home automation and for Alexa.

Thanks, Norman

Hi Norman,

@norman said in Problem with CalDav/Ical request with time-range filter:

The result is much better! Now with the query (first post) I get all events in this time range, but also the repeating events. I don’t know why - but for me it’s ok, because I can filter this ones in a second step.

That’s because the recurring events which might occur in the filter range (e.g. the recurrence end is after the start of the range or the recurrence start is before the end of the range) are also included in the list. kdav doesn’t expand the recurrences to check if one or more of the occurrences of the recurrence would happen in the range because that’s quite expensive operation.

Manfred

Ok - now I use a PHP RRule Parser (https://github.com/rlanvin/php-rrule) to get the event list from the reccuring events. That works fine.

$rrule = new RRule($eventArray["RRULE"], $datetime->format('Ymd\THis\Z'));
$res = $rrule->getOccurrencesBetween($startZ->getTimestamp(), $endZ->getTimestamp());

Norman