Format timestamps according to client locale

This commit is contained in:
Zaid Abdulla committed 2018-12-26 00:22:07 -08:00
1 parent d222e488c2
commit 8b540c2a97
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ const component = {
if (!param || !param.value) return m("span.na", "N/A"); if (!param || !param.value) return m("span.na", "N/A");
let value = param.value[0]; let value = param.value[0];
if (param.value[1] === "xsd:dateTime") if (param.value[1] === "xsd:dateTime")
value = new Date(value).toISOString(); value = new Date(value).toLocaleString();
let edit; let edit;
if (param.writable) if (param.writable)
+2 -2
View File
@@ -9,7 +9,7 @@ import * as store from "./store";
import * as notifications from "./notifications"; import * as notifications from "./notifications";
function init(args) { function init(args) {
if (!window.authorizer.hasAccess("devices", 2)) if (!window.authorizer.hasAccess("faults", 2))
return Promise.reject( return Promise.reject(
new Error("You are not authorized to view this page") new Error("You are not authorized to view this page")
); );
@@ -77,7 +77,7 @@ function renderTable(faultsResponse, total, selected, showMoreCallback) {
m("td", f["code"]), m("td", f["code"]),
m("td", f["message"]), m("td", f["message"]),
m("td", f["retries"]), m("td", f["retries"]),
m("td", f["timestamp"]) m("td", new Date(f["timestamp"]).toLocaleString())
) )
); );
} }