Files
avz-site/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js
T
2026-05-30 19:59:39 -03:00

13 lines
361 B
JavaScript

/**
* Returns an array of calendar weeks from an array of calendar months.
*
* @param months The array of calendar months.
* @returns An array of calendar weeks.
*/
export function getWeeks(months) {
const initialWeeks = [];
return months.reduce((weeks, month) => {
return weeks.concat(month.weeks.slice());
}, initialWeeks.slice());
}