|
1 | | -import { omit } from "lodash"; |
2 | 1 | import { Options, RRule, RRuleStrOptions, rrulestr } from "rrule"; |
3 | 2 | import { GCAL_MAX_RECURRENCES } from "@core/constants/core.constants"; |
4 | 3 | import { gEventToCompassEvent } from "@core/mappers/map.event"; |
@@ -75,22 +74,22 @@ export class GcalEventRRule extends RRule { |
75 | 74 | const startDate = dayjs(date).tz(tzid); |
76 | 75 | const endDate = startDate.add(this.#durationMs, "milliseconds"); |
77 | 76 |
|
78 | | - return omit( |
79 | | - { |
80 | | - ...this.#event, |
81 | | - id: `${this.#event.id}_${startDate.toRRuleDTSTARTString(this.#isAllDay)}`, |
82 | | - recurringEventId: this.#event.id!, |
83 | | - start: { |
84 | | - [this.#dateKey]: startDate?.format(this.#dateFormat), |
85 | | - timeZone: this.#event.start?.timeZone ?? timezone, |
86 | | - }, |
87 | | - end: { |
88 | | - [this.#dateKey]: endDate.format(this.#dateFormat), |
89 | | - timeZone: this.#event.end?.timeZone ?? timezone, |
90 | | - }, |
| 77 | + // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 78 | + const { recurrence, ...eventWithoutRecurrence } = { |
| 79 | + ...this.#event, |
| 80 | + id: `${this.#event.id}_${startDate.toRRuleDTSTARTString(this.#isAllDay)}`, |
| 81 | + recurringEventId: this.#event.id!, |
| 82 | + start: { |
| 83 | + [this.#dateKey]: startDate?.format(this.#dateFormat), |
| 84 | + timeZone: this.#event.start?.timeZone ?? timezone, |
91 | 85 | }, |
92 | | - ["recurrence"], |
93 | | - ); |
| 86 | + end: { |
| 87 | + [this.#dateKey]: endDate.format(this.#dateFormat), |
| 88 | + timeZone: this.#event.end?.timeZone ?? timezone, |
| 89 | + }, |
| 90 | + }; |
| 91 | + |
| 92 | + return eventWithoutRecurrence; |
94 | 93 | }); |
95 | 94 | } |
96 | 95 |
|
|
0 commit comments