Skip to content

FormatRelativeTimeOptions

The FormatRelativeTimeOptions type.

import type { FormatRelativeTimeOptions } from "@northguild/gmt/plain/format";
Member Type Description
style? "long" | "short" | "narrow"
numeric? "always" | "auto"
largestUnit? RelativeUnit
roundingMethod? RelativeRoundingMethod
reference? string
interface FormatRelativeTimeOptions {
style?: "long" | "short" | "narrow";
numeric?: "always" | "auto";
largestUnit?: RelativeUnit;
/**
* How the computed distance rounds to the display unit: "floor" rounds toward the
* earlier boundary, "ceil" toward the later boundary, "round" (default) to the nearest —
* matches current behavior when omitted.
*/
roundingMethod?: RelativeRoundingMethod;
reference?: string;
}

plain/format/formatRelativeTime.ts