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

Commit ab5af70

Browse files
committed
Fixes
Fix to #42(Firefox issue on changing month) and #51(Uncaught TypeError: Cannot read property 'className' of null)
1 parent 3c03200 commit ab5af70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/angular-datepicker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
angular.element($window).bind('click focus', function onClickOnWindow() {
157157

158158
if (!isMouseOn &&
159-
!isMouseOnInput) {
159+
!isMouseOnInput && theCalendar) {
160160

161161
$scope.hideCalendar();
162162
}
@@ -204,7 +204,7 @@
204204
$scope.monthNumber += 1;
205205
}
206206
//set next month
207-
$scope.month = $filter('date')(new Date($scope.year + '/' + $scope.monthNumber + '/01'), 'MMMM');
207+
$scope.month = $filter('date')(new Date($scope.year, $scope.monthNumber - 1), 'MMMM');
208208
//reinit days
209209
$scope.setDaysInMonth($scope.monthNumber, $scope.year);
210210

@@ -238,7 +238,7 @@
238238
$scope.monthNumber -= 1;
239239
}
240240
//set next month
241-
$scope.month = $filter('date')(new Date($scope.year + '/' + $scope.monthNumber + '/01'), 'MMMM');
241+
$scope.month = $filter('date')(new Date($scope.year, $scope.monthNumber - 1), 'MMMM');
242242
//reinit days
243243
$scope.setDaysInMonth($scope.monthNumber, $scope.year);
244244
//check if min date is ok

0 commit comments

Comments
 (0)