Skip to main content

FormatContext

What a formatter may know besides the value: the time now, for relative times, and the catalogue whose language its words and numbers are written in.

This is an interface exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import type { FormatContext } from "@mapcairn/core";

interface FormatContext

Properties​

catalogue​

readonly catalogue: MessageCatalogue;

The active catalogue: its language formats numbers and dates, and its keys word a relative time.

now​

readonly now: number;

Epoch milliseconds. Core never reads the clock itself.

See also​

Source: packages/core/src/layers/formatters.ts:12