@adyen/adyen-platform-experience-web
Version:

19 lines (18 loc) • 605 B
JavaScript
import m from "../../factory.js";
import { nowTimestamp as a } from "../../utils.js";
import { startOfMonth as i } from "../../../utils.js";
import { clamp as c } from "../../../../../../../utils/value/number.js";
const p = Object.freeze([0, 1, 0, 0, 0, 0, -1]), u = (e = 0) => {
const o = ~~c(0, e, 1 / 0) || 0;
return m({
from: ({ now: r, timezone: n, systemToTimezone: s, timezoneToSystem: f }) => {
const t = new Date(f(i(r, n)));
return t.setMonth(t.getMonth() - o), s(t);
},
...o ? { offsets: p } : { to: a }
});
};
export {
p as ONE_MONTH_OFFSETS,
u as default
};