mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-12-31 10:56:15 +01:00
finalize timed node state frontend code for status view
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user