mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ML] Improve calendar ics file parsing (#78986)
This commit is contained in:
parent
b692c374a2
commit
21353403b8
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue