Skip to content

Commit

Permalink
[ML] Improve calendar ics file parsing (elastic#78986) (elastic#79125)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic authored Oct 2, 2020
1 parent e80f4e5 commit e993559
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 e993559

Please sign in to comment.