fixed error in the last updated date of widgets

This commit is contained in:
dorian 2019-07-25 17:23:29 +02:00
parent 5304a38aa0
commit 83c80486ec
1 changed files with 4 additions and 1 deletions

View File

@ -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