1

I've got two nextcloud servers. In a python query I can query events for a time span. The query itself is successful. But the found events are strange. There are some results way out of the time span. The query data is:

<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav"> <d:prop><d:getetag /><c:calendar-data /></d:prop> <c:filter> <c:comp-filter name="VCALENDAR"> <c:comp-filter name="VEVENT"> <c:time-range start="20250911T000000" end="20250919T000000"/> </c:comp-filter> </c:comp-filter> </c:filter> </c:calendar-query> 

The request is made by:

requests.request( "REPORT", "https://my.nextcloud.de/remote.php/dav/calendars/myUser/myCalendar/", headers={"Depth": "1", "Content-Type": "text/html"}, auth=HTTPBasicAuth(reqName, reqPwd), data=reqData ) 

This gives a long list of calDAV data with events from 2024 for example. These are repeating events. I can epand this (thanks Gicu Aftene for the hint!), but now the times are missing time zone shift.

<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav"> <d:prop> <c:calendar-data> <c:expand start="20250907T000000" end="20250908T000000"/> </c:calendar-data> </d:prop> <c:filter> <c:comp-filter name="VCALENDAR"> <c:comp-filter name="VEVENT"> <c:time-range start="20250907T000000" end="20250908T000000"/> </c:comp-filter> </c:comp-filter> </c:filter> </c:calendar-query>' 

And the results changed their line endings with a coded return character in addition to a real return character (after the colon, as expected):

DTSTART:20250907T140000Z&#13;

3
  • 1
    Some times this kind of events into db have a time span indicated (sometimes called firstoccurrence and lastoccurrence) that not necessarily match the start and end (or duration) defined into related Calendar Object. What kind of CalDAV server you have? A custom made or something published? Because this sounds more a CalDAV server problem than a client query. Maybe something doesn't work properly during inserts or updates Commented Sep 11 at 13:11
  • 1
    You're right. They are repeating events. I changed my post to reflect the correct problem. Commented Sep 11 at 14:44
  • Well in that case, assuming caldav server works properly, when a recurring event is inserted it evaluates the last occurrence so it sets a proper lastoccurrence. They came up from the query because the time span you requested overlaps the firstoccurrence or the lastoccurrence dates... that happen even if there's no event that happen into time span, default clients manage that automatically evaluating the rrule, something like RRULE:FREQ=DAYLY, that is present into calendar object data definition. Some times this operation is called expand Commented Sep 11 at 15:06

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.