Prevent display of events in the past. #162

This commit is contained in:
Michael Teeuw 2016-04-23 17:40:44 +02:00
parent 4248ae7792
commit bd9557b11e
2 changed files with 4 additions and 3 deletions

View File

@ -124,7 +124,7 @@ Module.register("calendar",{
if (event.fullDayEvent) { if (event.fullDayEvent) {
if (event.today) { if (event.today) {
timeWrapper.innerHTML = this.translate("TODAY"); timeWrapper.innerHTML = this.translate("TODAY");
} else if (event.startDate - now < 24 * 60 * 60 * 1000) { } else if (event.startDate - now < 24 * 60 * 60 * 1000 && event.startDate - now > 0) {
timeWrapper.innerHTML = this.translate("TOMORROW"); timeWrapper.innerHTML = this.translate("TOMORROW");
} else { } else {
timeWrapper.innerHTML = moment(event.startDate,"x").fromNow(); timeWrapper.innerHTML = moment(event.startDate,"x").fromNow();
@ -141,7 +141,8 @@ Module.register("calendar",{
timeWrapper.innerHTML = this.translate("RUNNING") + ' ' + moment(event.endDate,"x").fromNow(true); timeWrapper.innerHTML = this.translate("RUNNING") + ' ' + moment(event.endDate,"x").fromNow(true);
} }
} }
// timeWrapper.innerHTML = moment(event.startDate,'x').format('lll'); //timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll');
//console.log(event);
timeWrapper.className = "time light"; timeWrapper.className = "time light";
eventWrapper.appendChild(timeWrapper); eventWrapper.appendChild(timeWrapper);

View File

@ -99,7 +99,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
continue; continue;
} }
if (fullDayEvent && endDate < today) { if (fullDayEvent && endDate <= today) {
//console.log("It's a fullday event, and it is before today. So skip: " + title); //console.log("It's a fullday event, and it is before today. So skip: " + title);
continue; continue;
} }