laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
12 lines (11 loc) • 450 B
JavaScript
"use client";
import { getDefaultOptions as c } from "./_lib/defaultOptions.js";
import { toDate as f } from "./toDate.js";
function O(o, e) {
const a = c(), s = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, t = f(o, e?.in), n = t.getDay(), r = (n < s ? 7 : 0) + n - s;
return t.setDate(t.getDate() - r), t.setHours(0, 0, 0, 0), t;
}
export {
O as default,
O as startOfWeek
};