Skip to content

Commit

Permalink
🐛 Fix iCalendar month bug (#2644)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffcom authored Jan 8, 2022
1 parent ac545b2 commit 95542a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/nodes-base/nodes/ICalendar/ICalendar.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
Expand Down

0 comments on commit 95542a5

Please sign in to comment.