summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.xml2
-rw-r--r--www/js/EventCtrl.js7
-rw-r--r--www/js/MontageCtrl.js35
-rw-r--r--www/templates/montage.html6
4 files changed, 40 insertions, 10 deletions
diff --git a/config.xml b/config.xml
index 5c2249b5..506aa2ac 100644
--- a/config.xml
+++ b/config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninjapro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.2.27" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninjapro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.2.28" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>zmNinja</name>
<description>
High performance ZoneMinder client
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index dfdbb779..f5719226 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -676,9 +676,10 @@ angular.module('zmApp.controllers')
disableBack: true
});
- var mToDate = moment();
-
- var mFromDate = moment().subtract(parseInt(val), unit);
+
+ // we have to convert from and to, to server time
+ var mToDate = moment().tz(NVRDataModel.getTimeZoneNow());
+ var mFromDate = moment().subtract(parseInt(val), unit).tz(NVRDataModel.getTimeZoneNow());
// console.log("Moment Dates:" + mFromDate.format() + " TO " + mToDate.format());
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 88487231..a012c0e7 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -389,7 +389,12 @@ angular.module('zmApp.controllers')
$rootScope.rand = Math.floor((Math.random() * 100000) + 1);
// if you see the time move, montage should move
- $scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec());
+
+ if ($scope.iconTimeNow == 'local')
+ $scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec());
+ else
+ $scope.timeNow = moment().tz(NVRDataModel.getTimeZoneNow()).format(NVRDataModel.getTimeFormatSec());
+ //$scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec());
//console.log ("Inside Montage timer...");
@@ -878,15 +883,37 @@ angular.module('zmApp.controllers')
});
+ $scope.toggleTimeType = function()
+ {
+ if (NVRDataModel.isTzSupported())
+ {
+ if ($scope.iconTimeNow == 'server')
+ $scope.iconTimeNow = 'local';
+ else
+ $scope.iconTimeNow = 'server';
+ }
+ else
+ NVRDataModel.debug ("timezone API not supported, can't display");
+ };
+
$scope.$on('$ionicView.afterEnter', function () {
NVRDataModel.debug("Setting image mode to snapshot, will change to image when packery is all done");
$scope.areImagesLoading = true;
$scope.isDragabillyOn = false;
- $scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec());
-
-
+
+ if (NVRDataModel.isTzSupported())
+ $scope.iconTimeNow = 'server';
+ else
+ $scope.iconTimeNow = 'local';
+
+ if ($scope.iconTimeNow == 'local')
+ $scope.timeNow = moment().format(NVRDataModel.getTimeFormatSec());
+ else
+ $scope.timeNow = moment().tz(NVRDataModel.getTimeZoneNow()).format(NVRDataModel.getTimeFormatSec());
+
+
$scope.gridScale = "grid-item-50";
$scope.LoginData = NVRDataModel.getLogin();
//FIXME
diff --git a/www/templates/montage.html b/www/templates/montage.html
index 18280cab..9d075faf 100644
--- a/www/templates/montage.html
+++ b/www/templates/montage.html
@@ -16,8 +16,10 @@
<ion-nav-buttons side="right">
-
- <span class="icon montage-time">{{timeNow}}&nbsp;</span>
+ <span ng-click="toggleTimeType()" class="icon montage-time">
+ <i ng-class="(iconTimeNow=='server')?'icon-server':'ion-ios-location'"></i>
+ {{timeNow}}&nbsp;</span>
+
<button class="button button-icon button-clear ion-arrow-move" ng-click="dragToggle();">&nbsp;
</button>