import {
addDays,
addMonths,
eachDayOfInterval,
eachWeekOfInterval,
startOfMonth,
} from 'date-fns'
const startOfMonthDate = startOfMonth(new Date())
const matrix = eachWeekOfInterval({
start: startOfMonthDate,
end: addMonths(startOfMonthDate, 1),
}).map((weekDay) => {
const startDate = new Date(weekDay)
return eachDayOfInterval({
start: startDate,
end: addDays(startDate, 6),
})
})