From 17d28c25a12b4000df5a28af446a9f525d648685 Mon Sep 17 00:00:00 2001 From: Hotte <root@ovanier.de> Date: Wed, 3 May 2017 11:23:30 +0200 Subject: [PATCH] Ich bin ein Pferd --- panels/mensaPlan/script.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/panels/mensaPlan/script.js b/panels/mensaPlan/script.js index 4afc27d..d026981 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(); -- GitLab