- /* First, check for all-day events */
- if (t1start.is_date) {
- if (!icaltime_compare_date_only(t1start, t2start)) {
- return(1);
- }
- if (!icaltime_is_null_time(t2end)) {
- if (!icaltime_compare_date_only(t1start, t2end)) {
- return(1);
- }
+ /* if either event lacks end time, assume end = start */
+ if (icaltime_is_null_time(t1end))
+ memcpy(&t1end, &t1start, sizeof(struct icaltimetype));
+ 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
+ */
+ icaltime_adjust(&t1end, -1, 0, 0, 0);