carddav: evaluate recurrence in match helper

The match helper will now properly return recurring events if any of
their recurrences fall into the queried time range. A test for this was
added as well.
This commit is contained in:
Conrad Hoffmann
2022-08-31 12:09:00 +02:00
committed by Conrad Hoffmann
parent 58dc8e4982
commit dc63df9058
2 changed files with 30 additions and 2 deletions

View File

@@ -253,6 +253,24 @@ END:VCALENDAR`)
addrs: []CalendarObject{event1, event2, event3, todo1},
want: []CalendarObject{event1},
},
{
// Query a time range that only returns a result if recurrence is properly evaluated.
name: "recurring events in time range",
query: &CalendarQuery{
CompFilter: CompFilter{
Name: "VCALENDAR",
Comps: []CompFilter{
CompFilter{
Name: "VEVENT",
Start: toDate(t, "20060103T000000Z"),
End: toDate(t, "20060104T000000Z"),
},
},
},
},
addrs: []CalendarObject{event1, event2, event3, todo1},
want: []CalendarObject{event2},
},
// TODO add more examples
} {
t.Run(tc.name, func(t *testing.T) {