Skip to content

canFormatTimeZone — @gj-kit/format

A public function from @gj-kit/format. The signature below is taken directly from the 0.1.1 release declaration.

import { canFormatTimeZone } from '@gj-kit/format';
/**
* Non-throwing probe: can this runtime render the given zone?
*
* `'UTC'` and `'device'` are always true (no Intl involved). For an IANA name it
* runs the same checks the formatters run and returns false instead of throwing,
* so an app can decide its own policy once at boot — e.g.
* `const zone = canFormatTimeZone('Asia/Seoul') ? 'Asia/Seoul' : 'UTC'`.
*
* Results are cached: the runtime-wide Intl self-test runs at most once, and each
* zone is checked at most once. Repeated calls are a map lookup.
*/
declare function canFormatTimeZone(timeZone: FormatTimeZone): boolean;

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/format
  • Version: 0.1.1
  • Public entry: .
  • Source: GitHub