UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

33 lines (32 loc) 1 kB
import n from "./TimeSlice.js"; import { RANGE_TO as c, RANGE_FROM as l } from "../constants.js"; import { withTimezone as r } from "../utils.js"; import { struct as f } from "../../../../../utils/struct/main.js"; import { getter as o } from "../../../../../utils/struct/property.js"; const m = ((...s) => { let t = r().tz.current, e = new n(t, ...s); return f({ from: o(() => e.startTimestamp, !1), to: o(() => e.endTimestamp, !1), offsets: { value: f({ from: o(() => e.startTimestampOffset, !1), to: o(() => e.endTimestampOffset, !1) }) }, span: o(() => e.numberOfMonths, !1), timezone: { ...o(() => t, !1), set: (i) => { const a = t; t = r(i ?? void 0).tz.current, t !== a && (e = new n(t, ...s)); } } }); }), p = m(), N = () => m(Date.now(), l), O = () => m(Date.now(), c), d = ((...s) => s.length === 0 ? p : m(...s)); export { p as UNBOUNDED_SLICE, d as default, N as sinceNow, O as untilNow };