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

Commit

Permalink
Merge pull request #249 from kuzma-sasha/master
Browse files Browse the repository at this point in the history
added logic for opening datepicker calendar
  • Loading branch information
45kb authored Mar 16, 2017
2 parents b74a3e0 + 5383073 commit 4525a7e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/js/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,17 @@
classHelper.add(theCalendar, '_720kb-datepicker-open');
}
$scope.today = new Date();
$timeout(function timeoutForYears() {
if ($scope.selectedDay) {
$scope.year = $scope.selectedYear;
$scope.monthNumber = $scope.selectedMonth;
} else {
$scope.year = $scope.today.getFullYear();
$scope.monthNumber = $scope.today.getMonth() + 1;
}
$scope.month = $filter('date')(new Date($scope.year, $scope.monthNumber - 1), 'MMMM');
setDaysInMonth($scope.monthNumber, $scope.year);
}, 0);
}
, checkToggle = function checkToggle() {
if (!$scope.datepickerToggle) {
Expand Down

0 comments on commit 4525a7e

Please sign in to comment.