summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/domain/daylongeventmodel.cpp5
-rw-r--r--views/calendar/main.qml3
2 files changed, 5 insertions, 3 deletions
diff --git a/framework/src/domain/daylongeventmodel.cpp b/framework/src/domain/daylongeventmodel.cpp
index 1b47edda..2b288ff5 100644
--- a/framework/src/domain/daylongeventmodel.cpp
+++ b/framework/src/domain/daylongeventmodel.cpp
@@ -81,7 +81,10 @@ QVariant DayLongEventModel::data(const QModelIndex &idx, int role) const
81 return dayIndex; 81 return dayIndex;
82 } 82 }
83 case Duration: 83 case Duration:
84 return event->getStartTime().date().daysTo(event->getEndTime().date()); 84 if (!event->getEndTime().isValid()) {
85 return 1;
86 }
87 return qMax(event->getStartTime().date().daysTo(event->getEndTime().date()), 1ll);
85 case Color: 88 case Color:
86 return getColor(event->getCalendar()); 89 return getColor(event->getCalendar());
87 } 90 }
diff --git a/views/calendar/main.qml b/views/calendar/main.qml
index 1e7e8eac..d27817f5 100644
--- a/views/calendar/main.qml
+++ b/views/calendar/main.qml
@@ -100,8 +100,7 @@ ApplicationWindow {
100 resource: "caldavresource", 100 resource: "caldavresource",
101 summary: "Test day-long event2", 101 summary: "Test day-long event2",
102 description: "This is test day-long event #2", 102 description: "This is test day-long event #2",
103 starts: "2018-04-11T00:00:00", 103 starts: "2018-04-11",
104 ends: "2018-04-23T00:00:00",
105 allDay: true, 104 allDay: true,
106 }, 105 },
107 { 106 {