@amboras-dev/tz
v0.1.1
Published
Store reporting timezone core for Amboras: supported IANA zones (modern names), old-name aliases, country default zones and DST-safe local-day boundaries. Zero dependencies.
Keywords
Readme
@amboras-dev/tz
Store reporting timezone core, shared by the Amboras orchestrator (backend + admin) and Medusa. Zero dependencies; CommonJS + ESM + types; Node >= 20 and browsers.
import { resolveZone, canonicalZone, pickStoreZone, localDayBoundsUtc, zoneOptions } from '@amboras-dev/tz'
canonicalZone('Asia/Calcutta') // 'Asia/Kolkata'
resolveZone('Mars/Phobos') // 'UTC'
pickStoreZone(undefined, 'US') // { zone: 'America/New_York', source: 'country_primary' }
localDayBoundsUtc('2026-08-13', 'Asia/Kolkata') // { start: 2026-08-12T18:30Z, end: 2026-08-13T18:30Z }- Modern names only. Browsers and Node still report old spellings
(
Asia/Calcutta,Europe/Kiev); every input goes throughcanonicalZone. - Fixed list, not the runtime's:
ZONE_LIST(418 zones incl.UTC),ZONE_ALIASES,COUNTRY_DEFAULT_ZONE, all generated from IANA tzdata byscripts/gen-tzdata.mjs(version inTZDATA_VERSION). CI fails if they drift; a weekly job opens a PR when IANA releases a new version. - Decisions live in the generator: the default zone for each multi-zone
country (
MULTI_ZONE), zones offered as aliases because older runtimes don't know them yet (ALIAS_INSTEAD), and pinned legacy names (EXTRA_ALIASES).
