Commit 2324098a authored by Glen Ditchfield's avatar Glen Ditchfield 🐛 Committed by Glen Ditchfield
Browse files

Fix month view's display of end-of-day instances

If a non-all-day instance extends to the end of a day, its dtEnd will
be 00:00 of the next day.  The month view incorrectly shows the instance
occurring on both days.

BUG: 165212
FIXED-IN: 5.16.3
parent f2e612aa
Pipeline #49862 passed with stage
in 6 minutes and 16 seconds
......@@ -358,7 +358,11 @@ QDate IncidenceMonthItem::realEndDate() const
return QDate();
}
const QDateTime dt = mIncidence->dateTime(KCalendarCore::Incidence::RoleDisplayEnd);
QDateTime dt = mIncidence->dateTime(KCalendarCore::Incidence::RoleDisplayEnd);
if (!mIncidence->allDay()) {
// If dt's time portion is 00:00, the incidence ends on the previous day.
dt = dt.addSecs(-1);
}
const QDate end = dt.toLocalTime().date();
return end.addDays(mRecurDayOffset);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment