This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 34a28335bf93cd0b6679d9b9c649a676b1b9500c Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 18:03:03 2014 +0200 cast date to timestamp before send to server --- .../src/main/webapp/js/controllers/pollCtrl.js | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index 12e37f3..6e7faa0 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -623,6 +623,13 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr poll.endDate = poll.endDate.getTime(); } + if (angular.isDate(poll.beginChoiceDate)) { + poll.beginChoiceDate = poll.beginChoiceDate.getTime(); + } + if (angular.isDate(poll.endChoiceDate)) { + poll.endChoiceDate = poll.endChoiceDate.getTime(); + } + Poll.add(poll, function (data) { $rootScope.$broadcast('newSuccess', 'poll.saved'); if ($scope.data.poll.pollType != 'FREE') { @@ -994,14 +1001,23 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr }; $scope.savePoll = function () { - if (angular.isDate($scope.data.poll.beginDate)) { - $scope.data.poll.beginDate = $scope.data.poll.beginDate.getTime(); + var savePoll = angular.copy($scope.data.poll); + + if (angular.isDate(savePoll.beginDate)) { + savePoll.beginDate = savePoll.beginDate.getTime(); + } + if (angular.isDate(savePoll.endDate)) { + savePoll.endDate = savePoll.endDate.getTime(); + } + + if (angular.isDate(savePoll.beginChoiceDate)) { + savePoll.beginChoiceDate = savePoll.beginChoiceDate.getTime(); } - if (angular.isDate($scope.data.poll.endDate)) { - $scope.data.poll.endDate = $scope.data.poll.endDate.getTime(); + if (angular.isDate(savePoll.endChoiceDate)) { + savePoll.endChoiceDate = savePoll.endChoiceDate.getTime(); } - $scope.data.poll.$update({permission:$scope.globalVariables.pollToken}, function (data) { + Poll.update({permission:$scope.globalVariables.pollToken}, savePoll, function (data) { $rootScope.$broadcast('newSuccess', 'poll.saved'); }, function (error) { angular.extend($scope.restError, error.data); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.