Skip to content

Commit

Permalink
Merge pull request #1271 from plone/recurrencewidget-fix2
Browse files Browse the repository at this point in the history
Fix wrong month in BYENDDATE and RDATE when adding and occurrence
  • Loading branch information
petschki authored Jan 13, 2023
2 parents c31dcf0 + 76099ff commit 28b0a39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pat/recurrence/recurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,11 @@ function widgetSaveToRfc5545(form, icaldata, conf, tz, start_date) {
result += "Z";
}
human += ", " + conf.localization.rangeByEndDateHuman;
var date_parts = date.split("-");
human +=
" " +
format(
new Date(...date.split("-")),
new Date(date_parts[0], date_parts[1]-1, date_parts[2]),
conf.localization.longDateFormat,
conf
);
Expand Down Expand Up @@ -730,11 +731,12 @@ const RecurrenceInput = function (conf, textarea) {
// Add date only if it is not already in RDATE
if ($.inArray(datevalue, textarea["ical"].RDATE) === -1) {
textarea["ical"].RDATE.push(datevalue);
var date_parts = datevalue.split("-");
var $newdate =
$(`<div class="d-flex justify-content-between occurrence rdate">
<span class="rdate">
${format(
new Date(...datevalue.split("-")),
new Date(date_parts[0], date_parts[1]-1, date_parts[2]),
conf.localization.longDateFormat,
conf
)},
Expand Down

0 comments on commit 28b0a39

Please sign in to comment.