finalize timed node state frontend code for status view

This commit is contained in:
Christoph Kluge
2025-11-11 17:03:59 +01:00
parent ecad52c18d
commit a6c43e6f2f
3 changed files with 199 additions and 400 deletions

View File

@@ -51,12 +51,13 @@ export function formatDurationTime(t, forNode = false) {
}
}
export function formatUnixTime(t) {
export function formatUnixTime(t, withDate = false) {
if (t !== null) {
if (isNaN(t)) {
return t;
} else {
return new Date(t * 1000).toLocaleString()
if (withDate) return new Date(t * 1000).toLocaleString();
else return new Date(t * 1000).toLocaleTimeString();
}
}
}