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

    Type Alias ElapsedDurationFormatSpec

    ElapsedDurationFormatSpec: {
        inputUnit?: "seconds" | "milliseconds";
        kind: "duration";
        locale?: string;
        negativeDisplay?: NegativeDisplay;
        roundingMode?: RoundingMode;
        signDisplay?: SignDisplay;
    } & { presentation: "elapsed" } & {
        [Key in keyof LocalizedDurationOptions]?: never
    }

    Exact scalar duration displayed as H:MM:SS, with unbounded total hours.

    Fractions are rounded to whole seconds using roundingMode. Scalar inputs and parsed results use seconds by default, or milliseconds with inputUnit. Records and localized component options are rejected. No Intl.DurationFormat service is needed. Ranges are unsupported.

    Type Declaration

    • OptionalinputUnit?: "seconds" | "milliseconds"

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

    • kind: "duration"

      Selects the built-in duration codec.

    • Optionallocale?: string

      BCP 47 locale overriding the formatter default for this operation.

    • OptionalnegativeDisplay?: NegativeDisplay

      Uses a localized sign or surrounding parentheses for negative values.

    • OptionalroundingMode?: RoundingMode

      Rounding direction for fractional scalar values. Defaults to halfExpand.

    • OptionalsignDisplay?: SignDisplay

      Controls when a positive or negative sign is displayed.

    • presentation: "elapsed"

      Selects scalar, parseable H:MM:SS output. Always required.

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

    const spec = { kind: "duration", presentation: "elapsed", inputUnit: "milliseconds" } as const;
    formatter.format(3661000, spec); // "1:01:01"
    parser.parse("1:01:01", spec); // "3661000"