DurationDisplay
Overview
Presents a duration in named units rather than its stored literal, so a read view says "730 days" instead of 730 00:00:00. A null or absent value renders the same dash {@link DateTimeDisplay} uses for an empty date.
Both serialized shapes are accepted: the Django duration string DRF's DurationField sends ([-]D HH:MM:SS[.ffffff]) and the number of seconds VUEDA's DurationSecondsField sends. Units that hold zero are left out, so a value only names the parts it has. A duration of zero names the smallest unit ("0 seconds"), which is a recorded value and not the same as no value at all. Sub-second precision is dropped.
Theme entry: DurationDisplay
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| themeOverride | Object | null | A partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants. | |
| value | string|number | undefined | The value to present, as a Django duration string or a number of seconds. null, undefined, and "" render the dash. | |
| format | string | "long" | "long" names each unit in full ("2 hours, 30 minutes"); "short" abbreviates it ("2h 30m"). | |
| inline | boolean | false | Renders without a wrapping element, for use inside an existing text row. | |
| class | import('vue').HTMLAttributes['class'] | undefined | Additional CSS classes applied to the root. |
Source
client/lib/display/duration-display/DurationDisplay.vue