diff --git a/src/scripts/services/ariaNgCommonService.js b/src/scripts/services/ariaNgCommonService.js index b53fa79..7164823 100644 --- a/src/scripts/services/ariaNgCommonService.js +++ b/src/scripts/services/ariaNgCommonService.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - angular.module('ariaNg').factory('ariaNgCommonService', ['$location', '$timeout', 'base64', 'SweetAlert', '$translate', 'ariaNgConstants', function ($location, $timeout, base64, SweetAlert, $translate, ariaNgConstants) { + angular.module('ariaNg').factory('ariaNgCommonService', ['$location', '$timeout', 'base64', 'moment', 'SweetAlert', '$translate', 'ariaNgConstants', function ($location, $timeout, base64, moment, SweetAlert, $translate, ariaNgConstants) { return { generateUniqueId: function () { var sourceId = ariaNgConstants.appPrefix + '_' + Math.round(new Date().getTime() / 1000) + '_' + Math.random(); @@ -215,6 +215,12 @@ return obj; }, + getCurrentUnixTime: function () { + return moment().format('X'); + }, + getLongTimeFronUnixTime: function (unixTime) { + return moment(unixTime, 'X').format('HH:mm:ss'); + }, getTimeOptions: function (timeList, withDisabled) { var options = []; diff --git a/src/scripts/services/ariaNgLogService.js b/src/scripts/services/ariaNgLogService.js index b71ac08..4de501e 100644 --- a/src/scripts/services/ariaNgLogService.js +++ b/src/scripts/services/ariaNgLogService.js @@ -1,13 +1,13 @@ (function () { 'use strict'; - angular.module('ariaNg').factory('ariaNgLogService', ['$log', 'moment', 'ariaNgConstants', function ($log, moment, ariaNgConstants) { + angular.module('ariaNg').factory('ariaNgLogService', ['$log', 'ariaNgConstants', function ($log, ariaNgConstants) { var enableDebugLog = false; var cachedDebugLogs = []; var createNewCacheLogItem = function (msg, level, obj) { return { - time: moment(), + time: new Date(), level: level, content: msg, attachment: obj diff --git a/src/scripts/services/ariaNgMonitorService.js b/src/scripts/services/ariaNgMonitorService.js index 9269629..286c611 100644 --- a/src/scripts/services/ariaNgMonitorService.js +++ b/src/scripts/services/ariaNgMonitorService.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - angular.module('ariaNg').factory('ariaNgMonitorService', ['$filter', '$translate', 'moment', 'ariaNgConstants', function ($filter, $translate, moment, ariaNgConstants) { + angular.module('ariaNg').factory('ariaNgMonitorService', ['$filter', '$translate', 'ariaNgConstants', 'ariaNgCommonService', function ($filter, $translate, ariaNgConstants, ariaNgCommonService) { var currentGlobalStat = {}; var storagesInMemory = {}; var globalStorageKey = 'global'; @@ -32,7 +32,7 @@ return '