diff --git a/src/components/EventEdit.tsx b/src/components/EventEdit.tsx index bd3c6d8..22b7d51 100644 --- a/src/components/EventEdit.tsx +++ b/src/components/EventEdit.tsx @@ -107,7 +107,13 @@ class EventEdit extends React.PureComponent { this.state.location = event.location ? event.location : ''; this.state.description = event.description ? event.description : ''; this.state.timezone = event.timezone; - this.state.rrule = this.props.item?.component.getFirstPropertyValue('rrule')?.toJSON(); + const rruleProp = this.props.item?.component.getFirstPropertyValue('rrule'); + if (rruleProp) { + this.state.rrule = rruleProp.toJSON(); + if (rruleProp.until) { + this.state.rrule.until = rruleProp.until; + } + } } else { this.state.uid = uuid.v4(); } diff --git a/src/types/ical.js.d.ts b/src/types/ical.js.d.ts index fe42660..da05e89 100644 --- a/src/types/ical.js.d.ts +++ b/src/types/ical.js.d.ts @@ -175,6 +175,8 @@ declare module 'ical.js' { export class Recur { constructor(data?: RecurData); - public toJSON(): RecurData; + public until: Time | null; + + public toJSON(): Omit & { until?: string }; } }