Commit 7145b74b authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg

Fix calendar list upcoming items

parent 8bc41d1d
......@@ -5,12 +5,15 @@ class ListView extends FullCalendar.View {
skeleton.classList.add('accordion', 'bordered');
const locale = this.dateEnv.locale.codeArg;
const events = Object.values(eventStore.instances);
events.sort(function (a, b) {
return a.range.start < b.range.start ? -1 :
a.range.start > b.range.start ? 1 : 0;
});
const now = new Date();
const events = Object.values(eventStore.instances)
.filter(function (value) {
return value.range.end > now;
})
.sort(function (a, b) {
return a.range.start < b.range.start ? -1 :
a.range.start > b.range.start ? 1 : 0;
});
if (events.length === 0) {
var alertEl = document.createElement('div');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment