Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(datepickerPopup): convert numbers to date before parsing
Browse files Browse the repository at this point in the history
Closes #5873
Fixes #5871
  • Loading branch information
mebibou authored and wesleycho committed May 4, 2016
1 parent a417ec2 commit 5188463
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/datepickerPopup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
return value;
}

$scope.date = dateParser.fromTimezone(value, timezone);

if (angular.isNumber($scope.date)) {
$scope.date = new Date($scope.date);
if (angular.isNumber(value)) {
value = new Date(value);
}

$scope.date = dateParser.fromTimezone(value, timezone);

return dateParser.filter($scope.date, dateFormat);
});
} else {
Expand Down

0 comments on commit 5188463

Please sign in to comment.