Fixing bug that prevented the middleware from working with Thunderbird on Microschrott Windoof
All checks were successful
Jenkins Production Deployment

- FUCK FILE ENCODINGS
- FUCK BILL GATES
This commit is contained in:
Patrick Müller 2021-10-13 13:10:35 +02:00
parent 7622416a2f
commit 2c2e8610c3

View File

@ -48,7 +48,7 @@ export const parseIcal = function (icalContents: string): iCalFile {
header = headerMatch[0]; header = headerMatch[0];
} }
header = header.substr(0, header.lastIndexOf('\n')); header = header.substr(0, header.lastIndexOf('\n') + 1);
let events: iCalEvent[] = []; let events: iCalEvent[] = [];
let match: any; let match: any;
@ -106,14 +106,14 @@ export const getDuration = function(event: string): number {
let endDt = new Date(endDtYear, endDtMonth - 1, endDtDay, endDtHour, endDtMinute); let endDt = new Date(endDtYear, endDtMonth - 1, endDtDay, endDtHour, endDtMinute);
return endDt.getHours() - startDt.getHours(); return endDt.getHours() - startDt.getHours();
} };
export const serializeIcal = function (ical: iCalFile): string { export const serializeIcal = function (ical: iCalFile): string {
let resString = ical.head; let resString = ical.head;
ical.body.forEach((event) => { ical.body.forEach((event) => {
resString += event.content + '\n'; resString += event.content + '\n';
}); });
resString += 'END:VCALENDAR'; resString += 'END:VCALENDAR\n';
return resString; return resString;
}; };