Fix calendar list upcoming items

parent 8bc41d1d
...@@ -5,12 +5,15 @@ class ListView extends FullCalendar.View { ...@@ -5,12 +5,15 @@ class ListView extends FullCalendar.View {
skeleton.classList.add('accordion', 'bordered'); skeleton.classList.add('accordion', 'bordered');
const locale = this.dateEnv.locale.codeArg; const locale = this.dateEnv.locale.codeArg;
const events = Object.values(eventStore.instances); const now = new Date();
const events = Object.values(eventStore.instances)
events.sort(function (a, b) { .filter(function (value) {
return a.range.start < b.range.start ? -1 : return value.range.end > now;
a.range.start > b.range.start ? 1 : 0; })
}); .sort(function (a, b) {
return a.range.start < b.range.start ? -1 :
a.range.start > b.range.start ? 1 : 0;
});
if (events.length === 0) { if (events.length === 0) {
var alertEl = document.createElement('div'); 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