mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-15 17:30:30 +00:00
Fix: Calendar widget iCal integration catch RRule failures (#2706)
This commit is contained in:
parent
f6ca3f57f7
commit
cca747c0fe
1 changed files with 9 additions and 4 deletions
|
@ -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());
|
||||
try {
|
||||
const rule = new RRule(recurrenceOptions);
|
||||
const recurringEvents = rule.between(startDate.toJSDate(), endDate.toJSDate());
|
||||
|
||||
recurringEvents.forEach((date, i) => eventToAdd(date, i, "recurring"));
|
||||
return;
|
||||
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…
Add table
Add a link
Reference in a new issue