UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

15 lines (14 loc) 429 B
"use client"; import { constructFrom as i } from "./constructFrom.js"; import { getDaysInMonth as m } from "./getDaysInMonth.js"; import { toDate as u } from "./toDate.js"; function h(n, e, r) { const t = u(n, r?.in), s = t.getFullYear(), a = t.getDate(), o = i(n, 0); o.setFullYear(s, e, 15), o.setHours(0, 0, 0, 0); const c = m(o); return t.setMonth(e, Math.min(a, c)), t; } export { h as default, h as setMonth };