Commit 0f5a526b authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

Do not display time of all-day events

parent 4605859e
Pipeline #3600 failed with stage
in 4 minutes and 41 seconds
......@@ -46,6 +46,7 @@ Kirigami.Page {
Component {
id: eventEditor
EventEditor {
calendar: localCalendar
......@@ -58,6 +59,7 @@ Kirigami.Page {
Kirigami.CardsListView {
id: cardsListview
anchors.fill: parent
model: Calindori.EventModel {
......@@ -96,10 +98,14 @@ Kirigami.Page {
Controls2.Label {
property bool sameEndStart : model.dtstart && !isNaN(model.dtstart) && model.dtend && !isNaN(model.dtend) && model.dtstart.toLocaleString(Qt.locale(), "dd.MM.yyyy") == model.dtend.toLocaleString(Qt.locale(), "dd.MM.yyyy")
property string timeFormat: model.allday ? "" : "hh:mm"
property string dateFormat: model.allday ? "ddd d MMM yyyy" : "ddd d MMM yyyy hh:mm"
property string separator: model.allday ? "" : " - "
wrapMode: Text.WordWrap
text: ((model.dtstart && !isNaN(model.dtstart)) ? model.dtstart.toLocaleString(Qt.locale(), "ddd d MMM yyyy hh:mm" ) : "") +
(model.dtend && !isNaN(model.dtend) ? " - " +
model.dtend.toLocaleString(Qt.locale(), sameEndStart ? "hh:mm" : "ddd d MMM yyyy hh:mm" ) : "")
text: ((model.dtstart && !isNaN(model.dtstart)) ? model.dtstart.toLocaleString(Qt.locale(), dateFormat ) : "") +
(model.dtend && !isNaN(model.dtend) ? separator +
model.dtend.toLocaleString(Qt.locale(), sameEndStart ? timeFormat : dateFormat ) : "")
}
Controls2.Label {
......
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