diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 13f6778132..77260e5665 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -282,9 +282,11 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst if ( scope.showWeeks ) { scope.weekNumbers = []; var thursdayIndex = (4 + 7 - ctrl.startingDay) % 7, - curWeek = 0, numWeeks = scope.rows.length; - while( curWeek < numWeeks ) {scope.weekNumbers.push(getISO8601WeekNumber( scope.rows[curWeek++][thursdayIndex].date ));} + for (var curWeek = 0; curWeek < numWeeks; curWeek++) { + scope.weekNumbers.push( + getISO8601WeekNumber( scope.rows[curWeek][thursdayIndex].date )); + } } }; diff --git a/src/datepicker/test/datepicker.spec.js b/src/datepicker/test/datepicker.spec.js index 153970609f..15cbc009e4 100644 --- a/src/datepicker/test/datepicker.spec.js +++ b/src/datepicker/test/datepicker.spec.js @@ -2070,9 +2070,6 @@ describe('datepicker directive', function () { }); describe('first week in january', function() { - beforeEach(inject(function() { - })); - it('in current year', function() { $rootScope.date = new Date('January 07, 2014'); element = $compile('')($rootScope);