}
else {
if (t1end.is_date && icaltime_compare(t1start, t1end)) {
-
- // The end date is non-inclusive so adjust it by one
- // day because our test is inclusive, note that a day is
- // not too much because we are talking about all day events.
- //
- // If start = end we assume that nevertheless the whole day is meant.
-
+ // The end date is non-inclusive so adjust it by one day because our test is inclusive.
+ // Note that a day is not too much because we are talking about all day events.
+ // If start==end we assume that it means one day.
icaltime_adjust(&t1end, -1, 0, 0, 0);
}
}
);
#endif
-
if (icaltime_is_null_time(t2end)) {
memcpy(&t2end, &t2start, sizeof(struct icaltimetype));
}
}
// Now check for overlaps using date *and* time.
+ // We could probably implement this in terms of icaltime_span_overlaps() but this does the same thing.
// If event 1 ends before event 2 starts, there is no match.
if (icaltime_compare(t1end, t2start) <= 0) return(0);
- // syslog(LOG_DEBUG, "calendar: first passed");
// If event 2 ends before event 1 starts, there is no match.
if (icaltime_compare(t2end, t1start) <= 0) return(0);
- // syslog(LOG_DEBUG, "calendar: second passed");
// Otherwise, there is an overlap, so yes we have a match.
return(1);