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

fix(datepicker popup): convert non-date values to date before parsing #5873

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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