From 8b540c2a97fa9206af7081d33c4d6842ee52f436 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Sun, 23 Dec 2018 04:48:07 -0800 Subject: [PATCH] Format timestamps according to client locale --- client/components/parameter.js | 2 +- client/faults-page.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/components/parameter.js b/client/components/parameter.js index 0e75687..0b339ec 100644 --- a/client/components/parameter.js +++ b/client/components/parameter.js @@ -11,7 +11,7 @@ const component = { if (!param || !param.value) return m("span.na", "N/A"); let value = param.value[0]; if (param.value[1] === "xsd:dateTime") - value = new Date(value).toISOString(); + value = new Date(value).toLocaleString(); let edit; if (param.writable) diff --git a/client/faults-page.js b/client/faults-page.js index 391138b..8faf397 100644 --- a/client/faults-page.js +++ b/client/faults-page.js @@ -9,7 +9,7 @@ import * as store from "./store"; import * as notifications from "./notifications"; function init(args) { - if (!window.authorizer.hasAccess("devices", 2)) + if (!window.authorizer.hasAccess("faults", 2)) return Promise.reject( 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["message"]), m("td", f["retries"]), - m("td", f["timestamp"]) + m("td", new Date(f["timestamp"]).toLocaleString()) ) ); }