Files
emaui/node_modules/@mantine/dates/esm/components/WeekdaysRow/get-weekdays-names/get-weekdays-names.mjs
2026-05-29 15:23:46 +03:00

23 lines
544 B
JavaScript

'use client';
import dayjs from 'dayjs';
function getWeekdayNames({
locale,
format = "dd",
firstDayOfWeek = 1
}) {
const baseDate = dayjs().day(firstDayOfWeek);
const labels = [];
for (let i = 0; i < 7; i += 1) {
if (typeof format === "string") {
labels.push(dayjs(baseDate).add(i, "days").locale(locale).format(format));
} else {
labels.push(format(dayjs(baseDate).add(i, "days").format("YYYY-MM-DD")));
}
}
return labels;
}
export { getWeekdayNames };
//# sourceMappingURL=get-weekdays-names.mjs.map