Cancelled events for recurring events, too

This commit is contained in:
Bandie 2020-05-22 03:25:10 +02:00
parent 103af8b4bb
commit 445842c991
Signed by: Bandie
GPG Key ID: 843D7FA93BA46312

View File

@ -129,6 +129,14 @@ function parseIcalData(data) {
events.map(function (e) {
var event = new ICAL.Event(e)
if (event.component.getFirstPropertyValue("status") == "CANCELLED") {
console.log(event)
if (!(cancelledEvents[event.uid] instanceof Array)) {
cancelledEvents[event.uid] = []
}
cancelledEvents[event.uid].push(event.startDate.toJSDate().getTime())
}
if (event.isRecurring()) {
var expand = event.iterator()
@ -145,16 +153,7 @@ function parseIcalData(data) {
}
}
} else if (eventInTimeRange(event, timeRangeStart, timeRangeStop)) {
if (event.component.getFirstPropertyValue("status") == "CANCELLED") {
console.log(event)
if (!(cancelledEvents[event.uid] instanceof Array)) {
cancelledEvents[event.uid] = []
}
cancelledEvents[event.uid].push(event.startDate.toJSDate().getTime())
} else {
eventList.push(new Event(event.startDate, event))
}
eventList.push(new Event(event.startDate, event))
}
})
}