Skip to content

formatDateTime — @gj-kit/format

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

import { formatDateTime } from '@gj-kit/format';
/**
* `YYYY-MM-DD HH:mm` (or `YYYY.MM.DD HH:mm`) in the given zone. 24-hour clock,
* no seconds. Month, day, hour and minute are always two digits; the year is
* rendered unpadded (`999-06-08`), matching the source apps and keeping the
* IANA path byte-identical to the `'UTC'`/`'device'` paths. Column width is
* therefore fixed for years 1000–9999, which is the range real data occupies.
*
* Instants outside `0001-01-01T14:00:00Z … 9999-12-31T09:59:59.999Z` render
* `fallback` — see {@link FormatDateOptions.fallback} for why the window is
* stated as instants rather than as years.
*/
declare function formatDateTime<TFallback = string>(value: FormatDateInput | null | undefined, options: FormatDateOptions<TFallback>): string | TFallback;

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