mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-06 07:23:38 +01:00
Fix: Calendar widget iCal integration catch RRule failures (#2706)
This commit is contained in:
parent
f6ca3f57f7
commit
cca747c0fe
@ -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) {
|
||||
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…
x
Reference in New Issue
Block a user