mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 10:04:46 -04:00
Only add future events
This commit is contained in:
parent
b297c99cbd
commit
e901b4e7c1
1 changed files with 4 additions and 1 deletions
|
@ -126,7 +126,10 @@ jQuery(document).ready(function($) {
|
||||||
var today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
var today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||||
var days = moment(e.startDate).diff(moment(today), 'days');
|
var days = moment(e.startDate).diff(moment(today), 'days');
|
||||||
|
|
||||||
eventList.push({'description':e.SUMMARY,'days':days});
|
//only add fututre events
|
||||||
|
if (days >= 0) {
|
||||||
|
eventList.push({'description':e.SUMMARY,'days':days});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
eventList.sort(function(a,b){return a.days-b.days});
|
eventList.sort(function(a,b){return a.days-b.days});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue