From 95542a5a8d40b25ccbaf2a29504a1892f622e852 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Sat, 8 Jan 2022 12:11:58 +0000 Subject: [PATCH] :bug: Fix iCalendar month bug (#2644) --- packages/nodes-base/nodes/ICalendar/ICalendar.node.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/ICalendar/ICalendar.node.ts b/packages/nodes-base/nodes/ICalendar/ICalendar.node.ts index b802664102a5d..287b1f0bd4df7 100644 --- a/packages/nodes-base/nodes/ICalendar/ICalendar.node.ts +++ b/packages/nodes-base/nodes/ICalendar/ICalendar.node.ts @@ -313,14 +313,19 @@ export class ICalendar implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; let fileName = 'event.ics'; + let eventStart = moment(start).toArray().splice(0, (allDay) ? 3 : 6) as ics.DateArray; + eventStart[1]++; + let eventEnd = moment(end).toArray().splice(0, (allDay) ? 3 : 6) as ics.DateArray; + eventEnd[1]++; + if (additionalFields.fileName) { fileName = additionalFields.fileName as string; } const data: ics.EventAttributes = { title, - start: (moment(start).toArray().splice(0, (allDay) ? 3 : 6) as ics.DateArray), - end: (moment(end).toArray().splice(0, (allDay) ? 3 : 6) as ics.DateArray), + start: eventStart, + end: eventEnd, startInputType: 'utc', endInputType: 'utc', };