laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
22 lines (21 loc) • 470 B
JavaScript
"use client";
import { constructFrom as s } from "./constructFrom.js";
import { toDate as f } from "./toDate.js";
function h(n, o, i) {
const t = f(n, i?.in);
if (isNaN(o)) return s(n, NaN);
if (!o)
return t;
const r = t.getDate(), e = s(n, t.getTime());
e.setMonth(t.getMonth() + o + 1, 0);
const a = e.getDate();
return r >= a ? e : (t.setFullYear(
e.getFullYear(),
e.getMonth(),
r
), t);
}
export {
h as addMonths,
h as default
};