Fix: Calendar widget iCal integration catch RRule failures (#2706)

pull/2534/head
shamoon 3 months ago committed by GitHub
parent f6ca3f57f7
commit cca747c0fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -60,11 +60,16 @@ export default function Integration({ config, params, setEvents, hideErrors, tim
const recurrenceOptions = event?.recurrenceRule?.origOptions;
if (recurrenceOptions && Object.keys(recurrenceOptions).length !== 0) {
const rule = new RRule(recurrenceOptions);
const recurringEvents = rule.between(startDate.toJSDate(), endDate.toJSDate());
recurringEvents.forEach((date, i) => eventToAdd(date, i, "recurring"));
return;
try {
const rule = new RRule(recurrenceOptions);
const recurringEvents = rule.between(startDate.toJSDate(), endDate.toJSDate());
recurringEvents.forEach((date, i) => eventToAdd(date, i, "recurring"));
return;
} catch (e) {
// eslint-disable-next-line no-console
console.error("Unable to parse recurring events from iCal: %s", e);
}
}
event.matchingDates.forEach((date, i) => eventToAdd(date, i, "single"));

Loading…
Cancel
Save