From 116883e20736b5da7334f1d3aaed4008dd3bd361 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 14 Jan 2020 21:18:41 +0200 Subject: [PATCH] ical.js types: fix ICAL.Recur's type and adjust code accordingly --- src/components/EventEdit.tsx | 2 +- src/types/ical.js.d.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/EventEdit.tsx b/src/components/EventEdit.tsx index 3d1630e..bd3c6d8 100644 --- a/src/components/EventEdit.tsx +++ b/src/components/EventEdit.tsx @@ -107,7 +107,7 @@ 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'); + this.state.rrule = this.props.item?.component.getFirstPropertyValue('rrule')?.toJSON(); } else { this.state.uid = uuid.v4(); } diff --git a/src/types/ical.js.d.ts b/src/types/ical.js.d.ts index 2af9689..fe42660 100644 --- a/src/types/ical.js.d.ts +++ b/src/types/ical.js.d.ts @@ -173,7 +173,8 @@ declare module 'ical.js' { public bysetpos?: number[]; } - export class Recur extends RecurData { + export class Recur { constructor(data?: RecurData); + public toJSON(): RecurData; } }