Skip to content

Commit

Permalink
[ML] Improve calendar ics file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Sep 30, 2020
1 parent cae36ce commit ec6cc83
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 ec6cc83

Please sign in to comment.