From 83c80486ec7ba5b5d563139e318ef1cb416ad123 Mon Sep 17 00:00:00 2001 From: dorian Date: Thu, 25 Jul 2019 17:23:29 +0200 Subject: [PATCH] fixed error in the last updated date of widgets --- js/dashboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/dashboard.js b/js/dashboard.js index 9e43794..4e35010 100644 --- a/js/dashboard.js +++ b/js/dashboard.js @@ -149,7 +149,9 @@ class BlueWeatherDashboard { var thisUpdateTime = document.createElement("small") thisUpdateTime.classList.add("text-muted") var lastUpdated = new Date(latestVal.timestamp * 1000) - thisUpdateTime.innerHTML = "last updated " + (lastUpdated.getDate() === new Date().getDate() ? "today" : lastUpdated.getFullYear + "-" + lastUpdated.getMonth() + "-" + lastUpdated.getDate()) + " at " + lastUpdated.getHours() + ":" + lastUpdated.getMinutes() + thisUpdateTime.innerHTML = "last updated " + + (lastUpdated.getDate() === new Date().getDate() ? "today" : lastUpdated.getFullYear() + "-" + lastUpdated.getMonth() + "-" + lastUpdated.getDate()) + + " at " + lastUpdated.getHours() + ":" + lastUpdated.getMinutes() thisFooter.appendChild(thisUpdateTime) thisWidget.appendChild(thisFooter) @@ -159,6 +161,7 @@ class BlueWeatherDashboard { switch (displayProperties.type) { case "doughnut": // the widget is gauge-like + thisWidget.classList.add("text-center") var thisChart = document.createElement("canvas") thisChart.id = "chartOf" + sensor.sensorname