X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/4a3782f2287399b05ed0aa59c0ac8c921a21a5c3..8422e1bb7ea6ab2bda185ef9d9b77cd41e7eb3d1:/web/static/seepark_web.js diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index 2aad39b..40fd919 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -149,6 +149,9 @@ function dayschart(element, title, days, xtickformat) { grid: { y: { show: true + }, + x: { + show: true } }, regions: [ @@ -220,19 +223,19 @@ setInterval( .then((resp) => resp.json()) .then(function(data) { airvalue.innerText = data['value'].toFixed(1); - airtime.innerText = strftime('%Y-%m-%d H:%M', data['timestamp']); + airtime.innerText = strftime('%Y-%m-%d %H:%M', new Date(data['timestamp'])); }) .catch(function(error) { - // handle error + console.log(error); }); fetch(api_url_currentwater) .then((resp) => resp.json()) .then(function(data) { watervalue.innerText = data['value'].toFixed(1); - watertime.innerText = strftime('%Y-%m-%d H:%M', data['timestamp']); + watertime.innerText = strftime('%Y-%m-%d %H:%M', new Date(data['timestamp'])); }) .catch(function(error) { - // handle error + console.log(error); }); }, refresh_interval