Skip to main content

time Renderer

renderAs: 'time' formats a time-only value using Intl.DateTimeFormat. Set parseMode to tell the renderer how to interpret the raw value.

Core Examples​

Basic Time​

ISO time strings formatted with locale defaults — hours and minutes, no seconds.

Name
Check-in
Scheduled
Aurora Chen
Mateo Silva
Priya Nair
{ key: 'checkin', renderAs: 'time', renderAsOptions: { parseMode: 'iso-time' } }

12h / 24h and Seconds​

hour12 forces 12- or 24-hour output. showSeconds adds the seconds component:

Same check-in time displayed as 12h without seconds and 24h with seconds.

Name
12h no seconds
24h with secs
Aurora Chen
Mateo Silva
Priya Nair
{ renderAs: 'time', renderAsOptions: { parseMode: 'iso-time', hour12: true, showSeconds: false } }
{ renderAs: 'time', renderAsOptions: { parseMode: 'iso-time', hour12: false, showSeconds: true } }

Timezone​

timezone accepts 'local', 'utc', or any IANA zone string. Affects the displayed clock time:

Same ISO time string displayed in local, UTC, and America/New_York timezones.

Name
Local
UTC
America/New_York
Aurora Chen
Mateo Silva
Priya Nair
{ renderAs: 'time', renderAsOptions: { parseMode: 'iso-time', timezone: 'local' } }
{ renderAs: 'time', renderAsOptions: { parseMode: 'iso-time', timezone: 'utc', showSeconds: true } }
{ renderAs: 'time', renderAsOptions: { parseMode: 'iso-time', timezone: 'America/New_York', showSeconds: true } }

Options Reference​

OptionTypeDefaultEffect
parseModeTemporalParseModerequiredHow to parse the raw value.
localestring'en-US'BCP 47 locale tag for Intl.DateTimeFormat.
timezonestring'local''local', 'utc', or IANA zone (e.g. 'Europe/Berlin').
showSecondsbooleanfalseInclude the seconds component in the output.
hour12booleanlocale defaulttrue forces AM/PM; false forces 24-hour. Omit to use locale default.
formatOptionsIntl.DateTimeFormatOptionsunsetFull Intl.DateTimeFormat options — merged over defaults. timeZone inside formatOptions takes precedence over timezone.
fallbackTextstring'Invalid'Text shown when the value cannot be parsed.
classNamestringunsetAdditional CSS class on the root element.

parseMode values​

ValueParses
'iso-time'HH:MM[:SS[.mmm]] strings (anchored to 1970-01-01)
'iso-datetime'ISO 8601 datetime strings
'epoch-ms'Unix timestamp in milliseconds
'epoch-sec'Unix timestamp in seconds
'any'Auto-detect

Caveats​

  • parseMode is required. Without it the renderer outputs fallbackText immediately.
  • iso-time values are anchored to 1970-01-01. Applying a timezone that converts the time across midnight may produce unexpected dates — though for time-only display this is generally invisible.
  • hour12: undefined (the default) defers to the locale. Set explicitly to true or false to override.
  • formatOptions merged over built-in options. A timeZone key inside formatOptions takes full precedence over the timezone option.
  • All options accept (entity) => value functions for per-row dynamic values.

See Also​