openmrs-esm-core

O3 Framework / DurationOptions

Interface: DurationOptions

Defined in: packages/framework/esm-utils/src/dates/date-util.ts:495

Extended by

Properties

largestUnit?

optional largestUnit: "auto" | DurationUnit

Defined in: packages/framework/esm-utils/src/dates/date-util.ts:503

Coarsest unit to include. Accepts ‘auto’ (default when smallestUnit is set), which resolves to the largest non-zero unit or smallestUnit, whichever is greater. Mirrors Temporal.Duration.round() behavior.


smallestUnit?

optional smallestUnit: DurationUnit

Defined in: packages/framework/esm-utils/src/dates/date-util.ts:505

Finest unit to include. Defaults to largestUnit when largestUnit is an explicit unit, giving a single-unit result.


thresholds?

optional thresholds: Partial<Record<DurationUnit, number>>

Defined in: packages/framework/esm-utils/src/dates/date-util.ts:497

Override auto-selection thresholds. Each value is in the unit’s own terms (e.g., seconds: 30 means “use seconds if < 30 seconds”).