[ML] Improve calendar ics file parsing (#78986)

This commit is contained in:
James Gowdy 2020-10-01 15:16:17 +01:00 committed by GitHub
parent b692c374a2
commit 21353403b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,10 @@ export function filterEvents(events) {
}
export function parseICSFile(data) {
const cal = icalendar.parse_calendar(data);
// force a new line char on the end of the data
// icalendar must split on new lines and so parsing fails
// if there isn't at least one new line at the end.
const cal = icalendar.parse_calendar(data + '\n');
return createEvents(cal);
}