diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-22 13:07:39 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-22 13:07:39 -0400 |
| commit | 017d1416fa9148f84596aa109826cacb13c1c774 (patch) | |
| tree | 9a13dedffae454c835dcdc64e9d5e900a2c16445 /www | |
| parent | 3e343e28c0120d5ebb540d3400eef86e6f1a7862 (diff) | |
#353 - more timezone tweaks, especially making sure humanizeTime is ALWAYS using local time irrespective of setting
Former-commit-id: d28f076eb0a780a83466f259d17563b8d2d34a0d
Diffstat (limited to 'www')
| -rw-r--r-- | www/css/style.css | 5 | ||||
| -rw-r--r-- | www/index.html | 27 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 14 | ||||
| -rw-r--r-- | www/js/TimelineModalCtrl.js | 3 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 2 | ||||
| -rw-r--r-- | www/templates/montage-history.html | 2 |
8 files changed, 41 insertions, 24 deletions
diff --git a/www/css/style.css b/www/css/style.css index 34866658..950a9e0d 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -21,6 +21,11 @@ font-family: "fontawesome"; content: "\f100"; } +.icon-server:before { + font-family: "fontawesome"; + content: "\f233"; +} + .image-loader-container { position: relative; width: 100%; diff --git a/www/index.html b/www/index.html index c04e169b..41e64912 100644 --- a/www/index.html +++ b/www/index.html @@ -186,17 +186,14 @@ </ion-item> <ion-item nav-clear menu-close href="#/login/false"> - - - <span class=" item-icon-left"> - <i class="icon ion-person"></i> - {{'kMenuZMSettings'|translate}} - <!--<span class="item-note" style="width:90px"> - {{$root.getProfileName();}} - </span>--> - <span style="float:right;margin-top:-18px;background-color:#444444;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;:text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;text-align:center;"> {{$root.getProfileName();}} </span> - </span> - + <span class=" item-icon-left"> + <i class="icon ion-person"></i> + {{'kMenuZMSettings'|translate}} + <!--<span class="item-note" style="width:90px"> + {{$root.getProfileName();}} + </span>--> + <span style="float:right;margin-top:-18px;background-color:#444444;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;:text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;text-align:center;"> {{$root.getProfileName();}} </span> + </span> </ion-item> <ion-item nav-clear menu-close href="#/devoptions"> @@ -260,6 +257,14 @@ </ion-item> </div> + + <ion-item style="color:rgb(106, 106, 106); font-size:90%;"> + <i class="ion-ios-location"></i> {{$root.getLocalTimeZone();}} <br/> + <span ng-if="$root.isTzSupported()"><i class="icon icon-server"></i> {{$root.getServerTimeZoneNow();}} </span> + </ion-item> + + + </ion-list> diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 66dec420..dfdbb779 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -1776,10 +1776,10 @@ angular.module('zmApp.controllers') function humanizeTime(str) { //console.log ("Time:"+str+" TO LOCAL " + moment(str).local().toString()); - if (NVRDataModel.getLogin().useLocalTimeZone) + //if (NVRDataModel.getLogin().useLocalTimeZone) return moment.tz(str, NVRDataModel.getTimeZoneNow()).fromNow(); - else - return moment(str).fromNow(); + // else + // return moment(str).fromNow(); } diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 37b41548..3674dab9 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -1169,10 +1169,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro function humanizeTime(str) { - if (NVRDataModel.getLogin().useLocalTimeZone) + // if (NVRDataModel.getLogin().useLocalTimeZone) return moment.tz(str, NVRDataModel.getTimeZoneNow()).fromNow(); - else - return moment(str).fromNow(); + // else + // return moment(str).fromNow(); } diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index 050d8e17..7b1ca2c1 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -12,6 +12,11 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc // nothing to do for now // eventUrl will use lower BW in next query cycle }); + + $scope.getLocalTZ = function() + { + return moment.tz.guess(); + }; //-------------------------------------- // formats events dates in a nice way //--------------------------------------- @@ -44,10 +49,10 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc return moment(str).format(NVRDataModel.getTimeFormat() + ' on MMMM Do YYYY'); }; $scope.humanizeTime = function (str) { - if (NVRDataModel.getLogin().useLocalTimeZone) + // if (NVRDataModel.getLogin().useLocalTimeZone) return moment.tz(str, NVRDataModel.getTimeZoneNow()).fromNow(); - else - return moment(str).fromNow(); + // else + // return moment(str).fromNow(); }; // if you change date in footer, change hrs @@ -197,7 +202,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc var TimeObjectTo = moment().format('YYYY-MM-DD HH:mm'); // At this point of time, we need to ensure From and To are changed to server time - if (NVRDataModel.getLogin().useLocalTimeZone) + //if (NVRDataModel.getLogin().useLocalTimeZone) + if (1) { var localtz = moment.tz.guess(); var servertz = NVRDataModel.getTimeZoneNow(); diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index 96f5c465..6531117e 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -446,7 +446,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' function humanizeTime(str) { - return moment(str).fromNow(); + return moment.tz(str, NVRDataModel.getTimeZoneNow()).fromNow(); + } diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 67ec3577..a04b2820 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -363,7 +363,7 @@ "kEventHistFaster" : "faster", "kEventHistPlay" : "play", "kEventHistPause" : "pause", - "kLocalTimeZone" :"convert to local timezone", + "kLocalTimeZone" :"use local timezone", "kTimeZoneNotSupported" : "your API doesn't support this", "kServerTimeZone" : "server TZ" diff --git a/www/templates/montage-history.html b/www/templates/montage-history.html index aa147c71..94659e93 100644 --- a/www/templates/montage-history.html +++ b/www/templates/montage-history.html @@ -107,7 +107,7 @@ </ion-pull-up-bar> <ion-pull-up-content scroll="true"> <div class="list list-inset"> - <div class="item item-divider">{{'kTimeline' | translate}}</div> + <div class="item item-divider">{{'kTimeline' | translate}} ({{getLocalTZ()}})</div> <div class="item item-input-inset"> {{'kFrom'|translate}}: <div class="row"> |
