@neutrium/formatter - v1.0.1
    Preparing search index...

    Interface LocalizedDurationFormatSpec

    Localized duration text from scalar values or calendar/time records.

    Requires native or polyfilled Intl.DurationFormat. This presentation cannot be parsed, does not support ranges, and omits roundedValue in detailed output. Scalars use inputUnit; records use their named components without converting calendar months or years into a scalar duration.

    import { formatter } from "@neutrium/formatter";

    formatter.format({ seconds: 1, milliseconds: 500 }, {
    kind: "duration", presentation: "localized", style: "digital", fractionalDigits: 3,
    });
    // "0:00:01.500"

    Hierarchy (View Summary)

    Index

    Presentation style for the days component.

    daysDisplay?: DurationUnitDisplay

    Whether a zero-valued days component is omitted or always displayed.

    fractionalDigits?: number

    Fraction digits shown for seconds and used to round scalar inputs; integer from 0 to 9.

    Presentation style for the hours component.

    hoursDisplay?: DurationUnitDisplay

    Whether a zero-valued hours component is omitted or always displayed.

    inputUnit?: "seconds" | "milliseconds"

    Unit of scalar inputs and parsed results. Defaults to seconds.

    kind: "duration"

    Selects the built-in duration codec.

    locale?: string

    BCP 47 locale overriding the formatter default for this operation.

    Presentation style for the microseconds component.

    microsecondsDisplay?: DurationUnitDisplay

    Whether a zero-valued microseconds component is omitted or always displayed.

    Presentation style for the milliseconds component.

    millisecondsDisplay?: DurationUnitDisplay

    Whether a zero-valued milliseconds component is omitted or always displayed.

    Presentation style for the minutes component.

    minutesDisplay?: DurationUnitDisplay

    Whether a zero-valued minutes component is omitted or always displayed.

    Presentation style for the months component.

    monthsDisplay?: DurationUnitDisplay

    Whether a zero-valued months component is omitted or always displayed.

    Presentation style for the nanoseconds component.

    nanosecondsDisplay?: DurationUnitDisplay

    Whether a zero-valued nanoseconds component is omitted or always displayed.

    negativeDisplay?: NegativeDisplay

    Uses a localized sign or surrounding parentheses for negative values.

    numberingSystem?: string

    Unicode numbering-system identifier used for numeric components.

    presentation: "localized"

    Selects localized, format-only duration text. Always required.

    roundingMode?: RoundingMode

    Rounding direction for fractional scalar values. Defaults to halfExpand.

    Presentation style for the seconds component.

    secondsDisplay?: DurationUnitDisplay

    Whether a zero-valued seconds component is omitted or always displayed.

    signDisplay?: SignDisplay

    Controls when a positive or negative sign is displayed.

    Localized presentation style. Defaults to short.

    Presentation style for the weeks component.

    weeksDisplay?: DurationUnitDisplay

    Whether a zero-valued weeks component is omitted or always displayed.

    Presentation style for the years component.

    yearsDisplay?: DurationUnitDisplay

    Whether a zero-valued years component is omitted or always displayed.