@ -62,10 +62,6 @@
getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj));
getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj));
}
}
function ts2Span(ts) {
return span(new Date(ts * 1000).toLocaleString('de-DE'));
}
function parseGeneric(obj) {
function parseGeneric(obj) {
if(exeOnce)
if(exeOnce)
parseESP(obj);
parseESP(obj);
@ -92,7 +88,7 @@
if(obj["ts_now"] < 1680000000 )
if(obj["ts_now"] < 1680000000 )
setTime();
setTime();
else
else
dSpan.innerHTML = date.toISOString().substring(0, 19).replace('T', ', ' );
dSpan.innerHTML = toIsoDateStr(date );
}
}
else {
else {
dSpan.innerHTML = "";
dSpan.innerHTML = "";
@ -157,7 +153,7 @@
if(false == i["is_avail"]) {
if(false == i["is_avail"]) {
if(i["ts_last_success"] > 0) {
if(i["ts_last_success"] > 0) {
var date = new Date(i["ts_last_success"] * 1000);
var date = new Date(i["ts_last_success"] * 1000);
p.append(span("-> last successful transmission: " + date.toISOString().substring(0, 19).replace('T', ', ' )), br());
p.append(span("-> last successful transmission: " + toIsoDateStr(date )), br());
}
}
}
}
}
}
@ -190,7 +186,7 @@
function tick() {
function tick() {
if(0 != ts)
if(0 != ts)
document.getElementById("date").innerHTML = (new Date((++ts) * 1000)).toISOString().substring(0, 19).replace('T', ', ' );
document.getElementById("date").innerHTML = toIsoDateStr( (new Date((++ts) * 1000)));
if(++tickCnt >= 10) {
if(++tickCnt >= 10) {
tickCnt = 0;
tickCnt = 0;
getAjax('/api/index', parse);
getAjax('/api/index', parse);