Fix for events repeating on mothly basis and old events that are shown as occuring today (#2624)

This commit is contained in:
Denis Papec 2024-01-14 21:49:28 +00:00 committed by GitHub
parent 9984e7894f
commit 674d7f2e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,8 +55,9 @@ export default function Integration({ config, params, setEvents, hideErrors }) {
}
};
if (event?.recurrenceRule?.options) {
const rule = new RRule(event.recurrenceRule.options);
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"));