Skip to content

Commit

Permalink
[ML] Improve calendar ics file parsing (#78986)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic authored Oct 1, 2020
1 parent b692c37 commit 2135340
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 2135340

Please sign in to comment.