This is a grouped issue because 2 bugs come from the exact same date formatting problem.
There are (at least) 3 dates format used in recurrence edition : the first one coming from plone.formwidget.recurrence through @@json_recurrence(20240508T000000), the one used in the pattern (2024-05-08T000000) and the one used when adding date through the date field (2024-05-08).
This is causing issues in dates edition of recurrences.
This is a grouped issue because 2 bugs come from the exact same date formatting problem.
There are (at least) 3 dates format used in recurrence edition : the first one coming from
plone.formwidget.recurrence
through@@json_recurrence
(20240508T000000
), the one used in the pattern (2024-05-08T000000
) and the one used when adding date through the date field (2024-05-08
).This is causing issues in dates edition of recurrences.
Bug 1 : you can add several times the same date
https://github.com/plone/mockup/assets/1101273/5fea60e7-a613-4487-b78a-1eaf147baeb1
Reason : the date added is referenced by the input field in format
2024-05-08
and the dates stored in the field are in format2024-05-08T000000
. Thus, this line never gets the comparison right : https://github.com/plone/mockup/blob/2058cfb695ba6311d680b27a6d6f650dbf87ba62/src/pat/recurrence/recurrence.js#L698Bug 2 : the wrong date is removed when you remove a date
https://github.com/plone/mockup/assets/1101273/22018353-3660-4c1f-960c-b701743238d6
Reason : the date you remove is referenced (by
<a date="...">
) in format20240508T000000
and the dates stored in the field are in format2024-05-08T000000
. Thus, these lines don't do the slicing correctly and remove the last date as$.inArray(this.attributes.date.value, textarea["ical"].RDATE)
will always return-1
: https://github.com/plone/mockup/blob/2058cfb695ba6311d680b27a6d6f650dbf87ba62/src/pat/recurrence/recurrence.js#L678-L681