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

fix(datepicker): support string in the non-HTML5 formatter #6439

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/datepickerPopup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
return value;
}

if (angular.isNumber(value)) {
if (!angular.isDate(value)) {
value = new Date(value);
}

Expand Down Expand Up @@ -356,7 +356,7 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $
}

if (angular.isString(value)) {
return !isNaN(parseDateString(value));
return !isNaN(parseDateString(value)) || value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.000Z$/);
}

return false;
Expand Down