Fix for events repeating on mothly basis and old events that are shown as occuring today

This commit is contained in:
Denis Papec 2024-01-14 21:32:50 +00:00
parent 9984e7894f
commit fa89da790f
No known key found for this signature in database
GPG Key ID: DE0912C69A47222C

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"));