diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index f1bb0cdea9..f4ec929a09 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -529,6 +529,11 @@ function ($compile, $parse, $document, $position, dateFilter, dateParser, datepi if (attrs.dateDisabled) { datepickerEl.attr('date-disabled', 'dateDisabled({ date: date, mode: mode })'); } + + if (attrs.showWeeks) { + datepickerEl.attr('show-weeks', attrs.showWeeks); + } + if (attrs.customClass){ datepickerEl.attr('custom-class', 'customClass({ date: date, mode: mode })'); } diff --git a/src/datepicker/test/datepicker.spec.js b/src/datepicker/test/datepicker.spec.js index 49e783884a..6bb46898a8 100644 --- a/src/datepicker/test/datepicker.spec.js +++ b/src/datepicker/test/datepicker.spec.js @@ -1640,6 +1640,30 @@ describe('datepicker directive', function () { assignElements(wrapElement); expect(dropdownEl.find('li').length).toBe(1); }); + + it('should hide weeks column on popup', function() { + var wrapElement = $compile('
')($rootScope); + $rootScope.$digest(); + assignElements(wrapElement); + + expect(getLabelsRow().find('th').eq(0)).toBeHidden(); + var tr = element.find('tbody').find('tr'); + for (var i = 0; i < 5; i++) { + expect(tr.eq(i).find('td').eq(0)).toBeHidden(); + } + }); + + it('should show weeks column on popup', function() { + var wrapElement = $compile('
')($rootScope); + $rootScope.$digest(); + assignElements(wrapElement); + + expect(getLabelsRow().find('th').eq(0)).not.toBeHidden(); + var tr = element.find('tbody').find('tr'); + for (var i = 0; i < 5; i++) { + expect(tr.eq(i).find('td').eq(0)).not.toBeHidden(); + } + }); }); describe('`ng-change`', function() {