diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-03 15:35:25 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-03 15:35:25 +0200 |
commit | c45ac2847fccc6f7699330a183a7514ff4ca609a (patch) | |
tree | 68254d241d35825f44d64f8869c7851d11485859 | |
parent | 61ad02e69f3755749bec61d9bd763b63f508ec93 (diff) | |
download | kube-c45ac2847fccc6f7699330a183a7514ff4ca609a.tar.gz kube-c45ac2847fccc6f7699330a183a7514ff4ca609a.zip |
Fixed single day events.
(That's probably the typical case)
-rw-r--r-- | framework/src/domain/daylongeventmodel.cpp | 5 | ||||
-rw-r--r-- | views/calendar/main.qml | 3 |
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 | { |