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

Fix for: https://github.com/angular-ui/bootstrap/issues/3701 #3971

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/dateparser/dateparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ angular.module('ui.bootstrap.dateparser', [])

if ( results && results.length ) {
var fields, dt;
if (baseDate) {
if (angular.isDate(baseDate) && !isNaN(baseDate.getTime())) {
fields = {
year: baseDate.getFullYear(),
month: baseDate.getMonth(),
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ function ($compile, $parse, $document, $position, dateFilter, dateParser, datepi

// Detect changes in the view from the text box
ngModel.$viewChangeListeners.push(function () {
scope.date = dateParser.parse(ngModel.$viewValue, dateFormat, scope.date) || new Date(ngModel.$viewValue);
scope.date = dateParser.parse(ngModel.$viewValue, dateFormat, scope.date);
});

var documentClickBind = function(event) {
Expand Down