diff --git a/panels/mensaPlan/script.js b/panels/mensaPlan/script.js index 4afc27d637c387e851ab74a0c7d7ae6038c65af5..d0269816528b175d951e98e421a4155c70047322 100755 --- a/panels/mensaPlan/script.js +++ b/panels/mensaPlan/script.js @@ -4,7 +4,7 @@ this.checkShowCondition = function() { return 4*this.tabtime; } -this.show = function() { +this.show = function() { // switch tabs this.interval=setInterval(function() { var currentTab = $("#tabs").tabs('option', 'active'); @@ -43,14 +43,16 @@ function padTwo(num) { } function isNextDay() { - if (new Date().getHours() >= 15) { + if (new Date().getHours() >= 15) { + console.log("NEXT") return true; } + console.log("CURRENT") return false; } function calcDateAPI() { - if (isNextDay) { + if (isNextDay()) { return new Date().getFullYear() + "-" + padTwo(new Date().getMonth()+1) + "-" + (padTwo(new Date().getDate() + 1)); } else { return new Date().getFullYear() + "-" + padTwo(new Date().getMonth()+1) + "-" + padTwo(new Date().getDate()); @@ -58,7 +60,7 @@ function calcDateAPI() { } function calcTextDisplay() { - if (isNextDay) { + if (isNextDay()) { return "Mensaplan von MORGEN, dem " + (padTwo(new Date().getDate() + 1)) +"."+ padTwo(new Date().getMonth()+1) +"."+ new Date().getFullYear(); } else { return "Mensaplan von HEUTE, dem " + padTwo(new Date().getDate()) +"."+ padTwo(new Date().getMonth()+1) +"."+ new Date().getFullYear();