UNPKG

date-vir

Version:

Easy and explicit dates and times.

31 lines (30 loc) 643 B
import { Settings } from 'luxon'; import { allTimezoneNames } from './timezone-names.js'; /** * An enum of all possible timezone names. * * @category Timezone * @example * * ```ts * import {Timezone} from 'date-vir'; * * Timezone['Africa/Bamako']; * ``` */ export const Timezone = allTimezoneNames.reduce((accum, timezoneName) => { accum[timezoneName] = timezoneName; return accum; }, {}); /** * The timezone of the current user's environment. * * @category Timezone */ export const userTimezone = Settings.defaultZone.name; /** * The UTC timezone. * * @category Timezone */ export const utcTimezone = Timezone.UTC;