Skip to content

Commit

Permalink
Merge pull request #991 from rashidkpc/master
Browse files Browse the repository at this point in the history
Fix date moving backwards east of the prime meridian. Closes #709
  • Loading branch information
Rashid Khan committed Feb 25, 2014
2 parents 4ef2afd + c361d38 commit b6c771a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/app/panels/goal/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ define([
{ label : 'Complete', data : complete, color: querySrv.colors[parseInt($scope.$id, 16)%8] },
{ data : remaining, color: Chromath.lighten(querySrv.colors[parseInt($scope.$id, 16)%8],0.70).toString() }
];
console.log(parseInt($scope.$id, 16)%8);
$scope.$emit('render');
});
};
Expand Down
10 changes: 9 additions & 1 deletion src/app/panels/timepicker/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,18 @@ function (angular, app, _, moment, kbn) {
$scope.input.$setValidity("dummy", true);
$scope.temptime = cloneTime($scope.time);

// Date picker needs the date to be at the start of the day
//Date picker needs the date to be at the start of the day
$scope.temptime.from.date.setHours(0,0,0,0);
$scope.temptime.to.date.setHours(0,0,0,0);

console.log(new Date().getTimezoneOffset());

// This is an ugly hack, but works.
if(new Date().getTimezoneOffset() < 0) {
$scope.temptime.from.date = moment($scope.temptime.from.date).add('days',1).toDate();
$scope.temptime.to.date = moment($scope.temptime.to.date).add('days',1).toDate();
}

$q.when(customTimeModal).then(function(modalEl) {
modalEl.modal('show');
});
Expand Down

0 comments on commit b6c771a

Please sign in to comment.