Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
442 B
Text
14 lines
442 B
Text
import type { CalendarMonth, CalendarWeek } from "../classes/index.js";
|
|
|
|
/**
|
|
* 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: CalendarMonth[]) {
|
|
const initialWeeks: CalendarWeek[] = [];
|
|
return months.reduce((weeks, month) => {
|
|
return [...weeks, ...month.weeks];
|
|
}, initialWeeks);
|
|
}
|