Skip to content

Commit

Permalink
fix(datepicker popup): convert non-date values to date before parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mebibou committed May 4, 2016
1 parent a417ec2 commit 2e381e7
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 2e381e7

Please sign in to comment.