Skip to content

FormatRelativeDateTimeOptions

The FormatRelativeDateTimeOptions type.

import type { FormatRelativeDateTimeOptions } from "@northguild/gmt/plain/format";
Member Type Description
style? "long" | "short" | "narrow"
numeric? "always" | "auto"
largestUnit? RelativeUnit
roundingMethod? RelativeRoundingMethod
reference? string
interface FormatRelativeDateTimeOptions {
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/formatRelativeDateTime.ts