From 0af18b0255ced6469fc89acdff6a83f91bffe538 Mon Sep 17 00:00:00 2001 From: Turcy Date: Thu, 5 Sep 2019 16:25:22 +0530 Subject: [PATCH] Make device analytics timestamp human-readable --- .../public/js/device.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/public/js/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/public/js/device.js index e7a216dd3e6..e18af314333 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/public/js/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.analytics-view/public/js/device.js @@ -45,7 +45,14 @@ function drawTable(from, to) { order: [], ajax: { url: "/devicemgt/api/stats/paginate", - data: buildAjaxData + data: buildAjaxData, + dataSrc: function(json) { + return json.data.map(function(event) { + event[0] = new moment(event[0]). + format("YYYY-MM-DD HH:mm:ss.SSS"); + return event; + }) + } } }); } @@ -71,4 +78,4 @@ function buildAjaxData (){ return obj; -} \ No newline at end of file +}