UNPKG

@mantine/dates

Version:

Calendars, date and time pickers based on Mantine components

12 lines (11 loc) 412 B
"use client"; import dayjs from "dayjs"; //#region packages/@mantine/dates/src/components/Month/get-start-of-week/get-start-of-week.ts function getStartOfWeek(date, firstDayOfWeek = 1) { let value = dayjs(date); while (value.day() !== firstDayOfWeek) value = value.subtract(1, "day"); return value.format("YYYY-MM-DD"); } //#endregion export { getStartOfWeek }; //# sourceMappingURL=get-start-of-week.mjs.map