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

Commit

Permalink
fix(datepicker): min-date: timezone fix for literals tweaks
Browse files Browse the repository at this point in the history
* whitespace fixes
* set isNaN date on bad values like current codebase
  • Loading branch information
davious committed Nov 8, 2015
1 parent f2c1906 commit 9b425ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,10 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi
scope.watchData[key] = value;
if (key === 'minDate' || key === 'maxDate') {
var date = parseDate(value);
if(!date) {
var tryDate = new Date(value);
if(angular.isDate(tryDate) && !isNaN(tryDate)) {
dateArray = tryDate.toISOString().split('T')[0].split('-');
if (!date) {
date = new Date(value);
if (angular.isDate(date) && !isNaN(date)) {
var dateArray = date.toISOString().split('T')[0].split('-');
date = new Date(+dateArray[0], +dateArray[1] - 1, +dateArray[2]);
}
}
Expand Down

0 comments on commit 9b425ab

Please sign in to comment.