Files
avz-site/node_modules/@date-fns/tz/tz/index.js
T
2026-05-30 19:59:39 -03:00

12 lines
498 B
JavaScript

import { TZDate } from "../date/index.js";
/**
* The function creates accepts a time zone and returns a function that creates
* a new `TZDate` instance in the time zone from the provided value. Use it to
* provide the context for the date-fns functions, via the `in` option.
*
* @param timeZone - Time zone name (IANA or UTC offset)
*
* @returns Function that creates a new `TZDate` instance in the time zone
*/
export const tz = timeZone => value => TZDate.tz(timeZone, +new Date(value));