Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit af259ba

Browse files
author
Sam Jenkins
committed
stopped dates outside of min and max limits from being selected
1 parent c945a63 commit af259ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/js/angular-datepicker.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,11 @@
454454

455455
$scope.setDatepickerDay = function setDatepickeDay(day) {
456456

457-
if ($scope.isSelectableDate($scope.monthNumber, $scope.year, day)) {
458-
459-
$scope.day = Number(day);
460-
$scope.setInputValue();
461-
$scope.hideCalendar();
457+
if ($scope.isSelectableMaxDate($scope.year + '/' + $scope.monthNumber + '/' + day)
458+
&& $scope.isSelectableMinDate($scope.year + '/' + $scope.monthNumber + '/' + day)) {
459+
$scope.day = Number(day);
460+
$scope.setInputValue();
461+
$scope.hideCalendar();
462462
}
463463
};
464464

0 commit comments

Comments
 (0)