From c69c88e82f467ca894ac9394329a36de9d005235 Mon Sep 17 00:00:00 2001 From: Laurent Lasudry Date: Wed, 8 May 2024 17:14:46 +0200 Subject: [PATCH] Fix comparisons between different dates formats This refs #1379 --- src/pat/recurrence/recurrence.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pat/recurrence/recurrence.js b/src/pat/recurrence/recurrence.js index 00a5cebd1..37c753641 100644 --- a/src/pat/recurrence/recurrence.js +++ b/src/pat/recurrence/recurrence.js @@ -690,6 +690,8 @@ const RecurrenceInput = function (conf, textarea) { function occurrenceAdd(event) { event.preventDefault(); var datevalue = self.$modalForm.find(".riaddoccurrence input#adddate").val(); + var date_parts = datevalue.split("-"); + datevalue += datevalue.length === 10 ? "T000000" : ""; var errorarea = self.$modalForm.find(".riaddoccurrence div.alert"); errorarea.text(""); errorarea.hide(); @@ -697,7 +699,6 @@ const RecurrenceInput = function (conf, textarea) { // Add date only if it is not already in RDATE if (!textarea["ical"].RDATE.includes(datevalue)) { textarea["ical"].RDATE.push(datevalue); - var date_parts = datevalue.split("-"); var $newdate = $(`
@@ -772,6 +773,7 @@ const RecurrenceInput = function (conf, textarea) { y = parseInt(date.substring(0, 4), 10); m = parseInt(date.substring(4, 6), 10) - 1; // jan=0 d = parseInt(date.substring(6, 8), 10); + occurrence.date = `${y}-${zeropad(m+1)}-${zeropad(d)}T000000`; occurrence.formattedDate = format( new Date(y, m, d), conf.localization.longDateFormat,