aceUIDuration

The aceUIDuration widget lets the user enter a duration as a number combined with a unit (for example "5 Minutes" or "7 Days"). The value is stored as an ISO 8601 duration string.

Image

Configuration

Attribute Description Default
"units" Array

Ordered list of unit codes to expose in the unit dropdown. Supported codes: min, h, d, w, mo, y. If not configured, all units are shown.
all units
"defaultUnit" string

The unit selected for a new, empty value. Must be one of the configured units, otherwise the first configured unit is used.
first configured unit
"minValue" number

The minimum number allowed in the amount input.
0
"maxValue" number

The maximum number allowed in the amount input.
none
"step" number

A stepping interval for the amount input.
1
"minDuration" string

The minimum allowed duration as an ISO 8601 duration. Validated against the resolved duration regardless of unit, so a value of one day passes a PT5M minimum but one minute does not.
none
"maxDuration" string

The maximum allowed duration as an ISO 8601 duration. Validated the same way as minDuration.
none
"editable" boolean

When false, the widget renders the duration as read-only text instead of the editable amount and unit inputs.
true

The minValue, maxValue and step attributes constrain the amount number only. The minDuration and maxDuration attributes constrain the total duration across the chosen unit, and are reported during validation when violated.

Localization

This widget has localization support.

The unit labels and validation messages are localized.

Expected domain objects

This widget expects a single domain object of type string, holding an ISO 8601 duration (for example PT5M, PT2H, P7D).

Example template json

{
  "label": "Refresh interval",
  "name": "refreshInterval",
  "widget": "aceUIDuration",

  "config": {
    "units": ["min", "h", "d"],
    "defaultUnit": "min",
    "minValue": 1,
    "minDuration": "PT5M"
  },

  "domainObject": "externalCollection/refreshInterval"
}