laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
13 lines (12 loc) • 648 B
JavaScript
"use client";
import { getDefaultOptions as n } from "./_lib/defaultOptions.js";
import { toDate as s } from "./toDate.js";
function S(d, e) {
var f, l, O, u;
const a = n(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((l = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : l.weekStartsOn) ?? a.weekStartsOn ?? ((u = (O = a.locale) == null ? void 0 : O.options) == null ? void 0 : u.weekStartsOn) ?? 0, t = s(d, e == null ? void 0 : e.in), c = t.getDay(), k = (c < r ? -7 : 0) + 6 - (c - r);
return t.setDate(t.getDate() + k), t.setHours(23, 59, 59, 999), t;
}
export {
S as default,
S as endOfWeek
};