Cleanup outcommented logging

This commit is contained in:
Veeck 2020-05-18 10:13:54 +02:00 committed by rejas
parent 2334cbd78a
commit 8c319903dd
2 changed files with 8 additions and 16 deletions

View File

@ -282,7 +282,6 @@ Module.register("calendar", {
timeWrapper = document.createElement("td"); timeWrapper = document.createElement("td");
eventWrapper.appendChild(titleWrapper); eventWrapper.appendChild(titleWrapper);
//console.log(event.today);
var now = new Date(); var now = new Date();
// Define second, minute, hour, and day variables // Define second, minute, hour, and day variables
var oneSecond = 1000; // 1,000 milliseconds var oneSecond = 1000; // 1,000 milliseconds
@ -373,7 +372,6 @@ Module.register("calendar", {
} }
} }
//timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll'); //timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll');
//console.log(event);
timeWrapper.className = "time light " + this.timeClassForUrl(event.url); timeWrapper.className = "time light " + this.timeClassForUrl(event.url);
eventWrapper.appendChild(timeWrapper); eventWrapper.appendChild(timeWrapper);
} }

View File

@ -58,7 +58,6 @@ var CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntr
return; return;
} }
// console.log(data);
var newEvents = []; var newEvents = [];
// limitFunction doesn't do much limiting, see comment re: the dates array in rrule section below as to why we need to do the filtering ourselves // limitFunction doesn't do much limiting, see comment re: the dates array in rrule section below as to why we need to do the filtering ourselves
@ -275,29 +274,28 @@ var CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntr
} }
// end recurring event parsing // end recurring event parsing
} else { } else {
// console.log("Single event ...");
// Single event. // Single event.
var fullDayEvent = isFacebookBirthday ? true : isFullDayEvent(event); var fullDayEvent = isFacebookBirthday ? true : isFullDayEvent(event);
if (includePastEvents) { if (includePastEvents) {
// Past event is too far in the past, so skip.
if (endDate < past) { if (endDate < past) {
//console.log("Past event is too far in the past. So skip: " + title);
continue; continue;
} }
} else { } else {
// It's not a fullday event, and it is in the past, so skip.
if (!fullDayEvent && endDate < new Date()) { if (!fullDayEvent && endDate < new Date()) {
//console.log("It's not a fullday event, and it is in the past. So skip: " + title);
continue; continue;
} }
// It's a fullday event, and it is before today, So skip.
if (fullDayEvent && endDate <= today) { if (fullDayEvent && endDate <= today) {
//console.log("It's a fullday event, and it is before today. So skip: " + title);
continue; continue;
} }
} }
// It exceeds the maximumNumberOfDays limit, so skip.
if (startDate > future) { if (startDate > future) {
//console.log("It exceeds the maximumNumberOfDays limit. So skip: " + title);
continue; continue;
} }
@ -305,13 +303,12 @@ var CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntr
continue; continue;
} }
// adjust start date so multiple day events will be displayed as happening today even though they started some days ago already // Adjust start date so multiple day events will be displayed as happening today even though they started some days ago already
if (fullDayEvent && startDate <= today) { if (fullDayEvent && startDate <= today) {
startDate = moment(today); startDate = moment(today);
} }
// Every thing is good. Add it to the list. // Every thing is good. Add it to the list.
newEvents.push({ newEvents.push({
title: title, title: title,
startDate: startDate.format("x"), startDate: startDate.format("x"),
@ -330,8 +327,6 @@ var CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntr
return a.startDate - b.startDate; return a.startDate - b.startDate;
}); });
//console.log(newEvents);
events = newEvents.slice(0, maximumEntries); events = newEvents.slice(0, maximumEntries);
self.broadcastEvents(); self.broadcastEvents();
@ -342,8 +337,7 @@ var CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntr
/* scheduleTimer() /* scheduleTimer()
* Schedule the timer for the next update. * Schedule the timer for the next update.
*/ */
var scheduleTimer = function () { var scheduleTimer = function() {
//console.log('Schedule update timer.');
clearTimeout(reloadTimer); clearTimeout(reloadTimer);
reloadTimer = setTimeout(function () { reloadTimer = setTimeout(function () {
fetchCalendar(); fetchCalendar();
@ -441,8 +435,8 @@ var CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntr
/* broadcastItems() /* broadcastItems()
* Broadcast the existing events. * Broadcast the existing events.
*/ */
this.broadcastEvents = function () { this.broadcastEvents = function() {
//console.log('Broadcasting ' + events.length + ' events.'); console.info('Broadcasting ' + events.length + ' events.');
eventsReceivedCallback(self); eventsReceivedCallback(self);
}; };