diff --git a/src/Month.js b/src/Month.js index 16a7ba786d..a8ebed04c4 100644 --- a/src/Month.js +++ b/src/Month.js @@ -178,7 +178,7 @@ export default class Month extends Component { {weeks.map(week => { let weekNumber; if (showWeekNumbers) { - weekNumber = DateUtils.getWeekNumber(week[0]); + weekNumber = DateUtils.getWeekNumber(week[6]); } return (
{ .find('.DayPicker-WeekNumber') .at(1) .simulate('click'); - expect(handleWeekClick.mock.calls[0][0]).toBe(6); + expect(handleWeekClick.mock.calls[0][0]).toBe(7); expect(handleWeekClick.mock.calls[0][1]).toHaveLength(7); }); it('should call `onWeekClick` when pressing ENTER on a week number', () => { diff --git a/test/daypicker/rendering.js b/test/daypicker/rendering.js index cefb83b091..7ae196c678 100644 --- a/test/daypicker/rendering.js +++ b/test/daypicker/rendering.js @@ -352,7 +352,7 @@ describe('DayPicker’s rendering', () => { ); expect(wrapper.find('.DayPicker-WeekNumber')).toHaveLength(4); - expect(wrapper.find('.DayPicker-WeekNumber').at(1)).toHaveText('6'); + expect(wrapper.find('.DayPicker-WeekNumber').at(1)).toHaveText('7'); }); it('should use the specified class names', () => { const wrapper = mount(