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)

38 lines (37 loc) 810 B
import { useCallback as n, useMemo as c } from "../external/preact/hooks/dist/hooks.module.js"; import s from "../core/Context/useCoreContext.js"; const m = (o) => { const { i18n: e } = s(); return n( (...t) => { const r = e.timezone; try { return o(...t); } finally { e.timezone = r; } }, [e, o] ); }, u = (o) => { const { i18n: e } = s(), t = m( n(() => (e.timezone = void 0, e.timezone = o, e.timezone), [e, o]) ); return c(t, [t]); }, T = (o) => { const { i18n: e } = s(), t = u(o), r = m( n( (...i) => (e.timezone = t, e.date(...i)), [e, t] ) ), a = m( n( (...i) => (e.timezone = t, e.fullDate(...i)), [e, t] ) ); return { dateFormat: r, fullDateFormat: a }; }; export { T as default };