displayEndDate property
The inclusive last day/time of this event for display and bucketing.
NTUT stores all-day events with end set to next-day midnight
(exclusive — an event on Jan 5 has end = Jan 6 00:00:00). Subtracting
1 ms makes bucketing treat Jan 5 as the last day, not Jan 6. Timed
events have explicit non-midnight ends and are returned as-is — NTUT only
emits midnight ends for all-day events.
Implementation
DateTime get displayEndDate {
if (!allDay) return end;
return end.isAfter(start)
? end.subtract(const Duration(milliseconds: 1))
: start;
}