@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
16 lines (15 loc) • 783 B
JavaScript
"use client";
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
//#region packages/@mantine/dates/src/components/WeekdaysRow/get-weekdays-names/get-weekdays-names.ts
function getWeekdayNames({ locale, format = "dd", firstDayOfWeek = 1 }) {
const baseDate = (0, dayjs.default)().day(firstDayOfWeek);
const labels = [];
for (let i = 0; i < 7; i += 1) if (typeof format === "string") labels.push((0, dayjs.default)(baseDate).add(i, "days").locale(locale).format(format));
else labels.push(format((0, dayjs.default)(baseDate).add(i, "days").format("YYYY-MM-DD")));
return labels;
}
//#endregion
exports.getWeekdayNames = getWeekdayNames;
//# sourceMappingURL=get-weekdays-names.cjs.map