Component
DataTime
Published on
Description
The DataTime component formats date and time values using Intl.DateTimeFormat, rendering a <time> element with locale-aware formatting. It supports all DateTimeFormat options such as dateStyle and timeStyle.
Use DataTime for displaying publication dates, event times, or any temporal data. The default format uses dateStyle: 'long'.
Example
Accessibility
- Renders as a
<time>element with the machine-readable datetime preserved in thedatetimeattribute - Screen readers announce the human-readable formatted date
- The semantic
<time>element helps assistive technologies understand the content as temporal data
Related
- DataNumber — for numeric formatting
- DataEnum — for mapping values to labels
Variables
None