Commit c71366e0 authored by Volker Krause's avatar Volker Krause

Display multi-day events correctly in the timeline

parent 2592d793
......@@ -28,13 +28,15 @@ App.TimelineDelegate {
headerIconSource: "meeting-attending"
headerItem: RowLayout {
QQC2.Label {
text: reservationFor.name
text: root.rangeType == TimelineModel.RangeEnd ?
i18n("End: %1", reservationFor.name) : reservationFor.name
font.pointSize: Kirigami.Theme.defaultFont.pointSize * root.headerFontScale
color: Kirigami.Theme.textColor
Layout.fillWidth: true
}
QQC2.Label {
text: Localizer.formatTime(reservationFor, "startDate")
text: root.rangeType == TimelineModel.RangeEnd ?
Localizer.formatTime(reservationFor, "endDate") : Localizer.formatTime(reservationFor, "startDate")
font.pointSize: Kirigami.Theme.defaultFont.pointSize * root.headerFontScale
color: Kirigami.Theme.textColor
}
......
......@@ -52,6 +52,12 @@ using namespace KItinerary;
static bool needsSplitting(const QVariant &res)
{
// multi-day event?
if (JsonLd::isA<EventReservation>(res)) {
const auto ev = res.value<EventReservation>().reservationFor().value<Event>();
return ev.startDate().date() != ev.endDate().date() && ev.endDate().isValid();
}
return JsonLd::isA<LodgingReservation>(res)
|| JsonLd::isA<RentalCarReservation>(res);
}
......
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