MCPcopy Create free account
hub / github.com/react-dates/react-dates / setCalendarMonthWeeks

Method setCalendarMonthWeeks

src/components/DayPicker.jsx:702–713  ·  view source on GitHub ↗
(currentMonth)

Source from the content-addressed store, hash-verified

700 }
701
702 setCalendarMonthWeeks(currentMonth) {
703 const { numberOfMonths } = this.props;
704
705 this.calendarMonthWeeks = [];
706 let month = currentMonth.clone().subtract(1, 'months');
707 const firstDayOfWeek = this.getFirstDayOfWeek();
708 for (let i = 0; i < numberOfMonths + 2; i += 1) {
709 const numberOfWeeks = getNumberOfCalendarMonthWeeks(month, firstDayOfWeek);
710 this.calendarMonthWeeks.push(numberOfWeeks);
711 month = month.add(1, 'months');
712 }
713 }
714
715 setContainerRef(ref) {
716 this.container = ref;

Callers 4

constructorMethod · 0.95
componentDidMountMethod · 0.95
onMonthChangeMethod · 0.95
onYearChangeMethod · 0.95

Calls 2

getFirstDayOfWeekMethod · 0.95

Tested by

no test coverage detected