Commit aed7d7ad authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Recurrence end date time combo now uses datecombo

parent e29c3b6e
Pipeline #94880 canceled with stage
......@@ -619,49 +619,18 @@ Kirigami.ScrollablePage {
}
popup.z: 1000
}
QQC2.ComboBox {
DateCombo {
id: recurEndDateCombo
Layout.fillWidth: true
visible: endRecurType.currentIndex === 1
onVisibleChanged: if (visible && isNaN(root.incidenceWrapper.recurrenceData.endDateTime.getTime())) { root.incidenceWrapper.setRecurrenceDataItem("endDateTime", new Date()); }
editable: true
editText: root.incidenceWrapper.recurrenceData.endDateTime.toLocaleDateString(Qt.locale(), Locale.NarrowFormat);
inputMethodHints: Qt.ImhDate
property date dateFromText: Date.fromLocaleDateString(Qt.locale(), editText, Locale.NarrowFormat)
property bool validDate: !isNaN(dateFromText.getTime())
onDateFromTextChanged: {
const datePicker = recurEndDatePicker;
if (validDate && activeFocus) {
datePicker.selectedDate = dateFromText;
datePicker.clickedDate = dateFromText;
if (visible) {
root.incidenceWrapper.setRecurrenceDataItem("endDateTime", dateFromText);
}
}
onVisibleChanged: if (visible && isNaN(root.incidenceWrapper.recurrenceData.endDateTime.getTime())) {
root.incidenceWrapper.setRecurrenceDataItem("endDateTime", new Date());
}
popup: QQC2.Popup {
id: recurEndDatePopup
width: Kirigami.Units.gridUnit * 18
height: Kirigami.Units.gridUnit * 18
y: parent.y + parent.height
z: 1000
DatePicker {
id: recurEndDatePicker
anchors.fill: parent
onDatePicked: {
root.incidenceWrapper.setRecurrenceDataItem("endDateTime", pickedDate);
recurEndDatePopup.close();
}
}
}
display: root.incidenceWrapper.recurrenceData.endDateTimeDisplay
dateTime: root.incidenceWrapper.recurrenceData.endDateTime
onNewDateChosen: root.incidenceWrapper.setRecurrenceDataItem("endDateTime", new Date(year, month, day));
}
RowLayout {
......
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