diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 05784947d0..8a803b43a7 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -43,6 +43,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst }); $scope.datepickerMode = $scope.datepickerMode || datepickerConfig.datepickerMode; + $scope.maxMode = self.maxMode; $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000); this.activeDate = angular.isDefined($attrs.initDate) ? $scope.$parent.$eval($attrs.initDate) : new Date(); diff --git a/src/datepicker/test/datepicker.spec.js b/src/datepicker/test/datepicker.spec.js index b673d162da..2717cb87e6 100644 --- a/src/datepicker/test/datepicker.spec.js +++ b/src/datepicker/test/datepicker.spec.js @@ -12,12 +12,16 @@ describe('datepicker directive', function () { $rootScope.date = new Date('September 30, 2010 15:30:00'); })); + function getTitleButton() { + return element.find('th').eq(1).find('button').first(); + } + function getTitle() { - return element.find('th').eq(1).find('button').first().text(); + return getTitleButton().text(); } function clickTitleButton() { - element.find('th').eq(1).find('button').first().click(); + getTitleButton().click(); } function clickPreviousButton(times) { @@ -1710,5 +1714,13 @@ describe('datepicker directive', function () { clickTitleButton(); expect(getTitle()).toBe('2013'); }); + + it('disables the title button at it', function() { + expect(getTitleButton().prop('disabled')).toBe(false); + clickTitleButton(); + expect(getTitleButton().prop('disabled')).toBe(true); + clickTitleButton(); + expect(getTitleButton().prop('disabled')).toBe(true); + }); }); }); diff --git a/template/datepicker/day.html b/template/datepicker/day.html index ca212a391a..16537c00c8 100644 --- a/template/datepicker/day.html +++ b/template/datepicker/day.html @@ -2,7 +2,7 @@ - + diff --git a/template/datepicker/month.html b/template/datepicker/month.html index 539219004b..c59a7be7ac 100644 --- a/template/datepicker/month.html +++ b/template/datepicker/month.html @@ -2,7 +2,7 @@ - + diff --git a/template/datepicker/year.html b/template/datepicker/year.html index 978d80c232..98d47f0054 100644 --- a/template/datepicker/year.html +++ b/template/datepicker/year.html @@ -2,7 +2,7 @@ - +