function buildWeeks(year, monthIndex, firstDayOfWeek = 1) {
	const firstDateOfMonth = new Date(year, monthIndex);
	const firstDateOfCalendar = startOfWeek(firstDateOfMonth, {
		weekStartsOn: firstDayOfWeek,
	});

	const dates = new Array(7 * 6).fill(0).map((_, i) => addDays(firstDateOfCalendar, i));

	return chunk(dates, 7);
}
/**
 * Generate the set of weeks for a specific month
 */
Generate the set of weeks for a specific month
Generate the set of weeks for a specific month
function buildWeeks(year, monthIndex, firstDayOfWeek = 1) {
	const firstDateOfMonth = new Date(year, monthIndex);
	const firstDateOfCalendar = startOfWeek(firstDateOfMonth, {
		weekStartsOn: firstDayOfWeek,
	});
	const dates = new Array(7 * 6).fill(0).map((_, i) => addDays(firstDateOfCalendar, i));
	return chunk(dates, 7);
}
function buildWeeks ( year , monthIndex , firstDayOfWeek = 1 ) { const firstDateOfMonth = new Date ( year , monthIndex ) ; const firstDateOfCalendar = startOfWeek ( firstDateOfMonth , { weekStartsOn : firstDayOfWeek , } ) ; const dates = new Array ( 7 * 6 ) . fill ( 0 ) . map ( ( _ , i ) => addDays ( firstDateOfCalendar , i ) ) ; return chunk ( dates , 7 ) ; }
Generate the set of weeks for a specific month
Generate the set of weeks for a specific month