diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 13 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 8 | ||||
| -rw-r--r-- | www/js/EventsGraphsCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 8 | ||||
| -rw-r--r-- | www/js/app.js | 3 |
6 files changed, 26 insertions, 14 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 1b6b5c81..814c87ff 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -70,6 +70,7 @@ angular.module('zmApp.controllers') 'forceNetworkStop':false, 'defaultPushSound': false, 'enableBlog':true, + 'use24hr':false, }; @@ -284,6 +285,13 @@ angular.module('zmApp.controllers') } + if (typeof loginData.use24hr == 'undefined') + { + zmDebug ("use24hr does not exist. Setting to false"); + loginData.use24hr = false; + + } + if (typeof loginData.montageHistoryQuality == 'undefined') { zmDebug ("montageHistoryQuality does not exist. Setting to 50"); @@ -395,7 +403,10 @@ angular.module('zmApp.controllers') }, - + getTimeFormat: function() + { + return (loginData.use24hr ? "HH:mm": "hh:mm a"); + }, //------------------------------------------------------------------ // switches screen to 'always on' or 'auto' diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index c46a830b..2b3829d8 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -393,8 +393,8 @@ angular.module('zmApp.controllers') $scope.filterTapped = function () { //console.log("FILTER TAPPED"); - var myFrom = moment($rootScope.fromString).format("MMM/DD/YYYY hh:mm a").toString(); - var toString = moment($rootScope.toString).format("MMM/DD/YYYY hh:mm a").toString(); + var myFrom = moment($rootScope.fromString).format("MMM/DD/YYYY "+ZMDataModel.getTimeFormat()).toString(); + var toString = moment($rootScope.toString).format("MMM/DD/YYYY "+ZMDataModel.getTimeFormat()).toString(); $rootScope.zmPopup = $ionicPopup.confirm({ title: 'Filter settings', @@ -1484,12 +1484,12 @@ angular.module('zmApp.controllers') } $scope.prettifyTime = function (str) { - return moment(str).format('h:mm:ssa'); + return moment(str).format(ZMDataModel.getTimeFormat()); }; $scope.prettify = function (str) { - return moment(str).format('h:mm:ssa on MMMM Do YYYY'); + return moment(str).format(ZMDataModel.getTimeFormat()+' on MMMM Do YYYY'); }; //-------------------------------------------------------- // For consistency we are keeping the refresher list diff --git a/www/js/EventsGraphsCtrl.js b/www/js/EventsGraphsCtrl.js index fe1185e7..758e7ec8 100644 --- a/www/js/EventsGraphsCtrl.js +++ b/www/js/EventsGraphsCtrl.js @@ -141,8 +141,8 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni if (hrs) { // Apply a time based filter if I am not watching all events var cur = moment(); - endDate = cur.format("YYYY-MM-DD hh:mm:ss"); - startDate = cur.subtract(hrs, 'hours').format("YYYY-MM-DD hh:mm:ss"); + endDate = cur.format("YYYY-MM-DD "+ZMDataModel.getTimeFormat()); + startDate = cur.subtract(hrs, 'hours').format("YYYY-MM-DD "+ZMDataModel.getTimeFormat()); //console.log("Start and End " + startDate + "==" + endDate); ZMDataModel.zmLog("Generating graph for " + startDate + " to " + endDate); diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index d733e9f7..e30b65c8 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -18,7 +18,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc //--------------------------------------- $scope.prettifyDate = function (str) { - return moment(str).format('MMM Do, YYYY h:mma'); + return moment(str).format('MMM Do, YYYY '+ZMDataModel.getTimeFormat()); }; function prettifyDate(str) { @@ -32,7 +32,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc $scope.prettify = function (str) { - return moment(str).format('h:mm:ssa on MMMM Do YYYY'); + return moment(str).format(ZMDataModel.getTimeFormat()+' on MMMM Do YYYY'); }; diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 8f0a8057..30bb6089 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -49,7 +49,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla // Used to display date range for timeline //----------------------------------------------------------- $scope.prettify = function (str) { - return moment(str).format('MMMM Do YYYY, h:mm:ssa'); + return moment(str).format('MMMM Do YYYY, '+ZMDataModel.getTimeFormat()); }; //----------------------------------------------------------- @@ -475,12 +475,12 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla stack: false, format: { minorLabels: { - minute: "hh:mm a", - hour: 'hh:mm a', + minute: ZMDataModel.getTimeFormat(), + hour: ZMDataModel.getTimeFormat(), second: 's', }, majorLabels: { - second: "D MMM hh:mm a", + second: "D MMM "+ZMDataModel.getTimeFormat(), } }, diff --git a/www/js/app.js b/www/js/app.js index 2914ae7a..51922d6a 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1128,7 +1128,8 @@ angular.module('zmApp', [ // paths etc.https://github.com/pbakondy/filelogger $fileLogger.setStorageFilename(zm.logFile); // easier tz reading - $fileLogger.setTimestampFormat('medium'); + // $fileLogger.setTimestampFormat('medium'); + $fileLogger.setTimestampFormat('MMM d, y '+ZMDataModel.getTimeFormat()); ZMDataModel.zmLog("Deleting old log file as it exceeds " + zm.logFileMaxSize + " bytes"); |
