changed timestamp to UTC in ESP only, local timezone is calculated by browser thx @homeautomation22

This commit is contained in:
lumapu 2022-10-22 00:09:26 +02:00
parent 6ed2dfde9c
commit 72219cdf17
5 changed files with 37 additions and 55 deletions

View file

@ -76,8 +76,16 @@
}
var ts = div(["ts"]);
var date = new Date(iv["ts_last_success"] * 1000);
ts.innerHTML = "Last received data requested at: " + date.toLocaleString('de-DE', {timeZone: 'UTC'});
var ageInfo = "Last received data requested at: ";
if(iv["ts_last_success"] > 0) {
var date = new Date(iv["ts_last_success"] * 1000);
ageInfo += date.toLocaleString('de-DE');
}
else
ageInfo += "nothing received";
ts.innerHTML = ageInfo;
main.appendChild(ts);
ivHtml.push(main);
}