forked from Chaospott/site
Cancelled events for recurring events, too
This commit is contained in:
parent
103af8b4bb
commit
445842c991
@ -129,6 +129,14 @@ function parseIcalData(data) {
|
|||||||
|
|
||||||
events.map(function (e) {
|
events.map(function (e) {
|
||||||
var event = new ICAL.Event(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()) {
|
if (event.isRecurring()) {
|
||||||
var expand = event.iterator()
|
var expand = event.iterator()
|
||||||
@ -145,17 +153,8 @@ function parseIcalData(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventInTimeRange(event, timeRangeStart, timeRangeStop)) {
|
} 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))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user