🐛 Fix iCalendar month bug (#2644)

This commit is contained in:
Jonathan Bennetts 2022-01-08 12:11:58 +00:00 committed by GitHub
parent ac545b2573
commit 95542a5a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -313,14 +313,19 @@ export class ICalendar implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
let fileName = 'event.ics'; 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) { if (additionalFields.fileName) {
fileName = additionalFields.fileName as string; fileName = additionalFields.fileName as string;
} }
const data: ics.EventAttributes = { const data: ics.EventAttributes = {
title, title,
start: (moment(start).toArray().splice(0, (allDay) ? 3 : 6) as ics.DateArray), start: eventStart,
end: (moment(end).toArray().splice(0, (allDay) ? 3 : 6) as ics.DateArray), end: eventEnd,
startInputType: 'utc', startInputType: 'utc',
endInputType: 'utc', endInputType: 'utc',
}; };