From: gregor herrmann Date: Thu, 6 Sep 2018 15:58:39 +0000 (+0200) Subject: fix updating current air/water: strftime expects a "new Date" X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/fd44d83b7140ba44b5838c2eca7e6ebd91d27652 fix updating current air/water: strftime expects a "new Date" --- diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index 5baed88..fdc5377 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -220,7 +220,7 @@ 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) { console.log(error); @@ -229,7 +229,7 @@ setInterval( .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) { console.log(error);