Skip to content

Commit

Permalink
Check minDate/maxDate attributes before assigning
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii Fedorenko committed Mar 13, 2016
1 parent 2ecb83a commit d1c5ec4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ angular.module('ui.bootstrap.datetimepicker', ["ui.bootstrap.dateparser", "ui.bo
$scope.$watch(dateAttr, function (value) {
var date = new Date(value);
$scope.dateOptions[dateAttr] = date;
$scope[dateAttr] = date;
if ($scope[dateAttr]) {
$scope[dateAttr] = date;
}
}, true);
}
$scope.date_change = function () {
Expand Down

0 comments on commit d1c5ec4

Please sign in to comment.