Relative Time

Relative time is a component to transform date into human readable text. Date can be passed within component in ISO format (YYYY-MM-DDThh:mm) or as DD-MM-YYYY. Can be passed also as attribute datetime value.

By clicking on the relative time string one can toggle between relative time and actual date.

Examples (5)
Example Code
08-12-2025 <as-relative-time>08-12-2025</as-relative-time>
08-12-2026 <as-relative-time disabled>08-12-2026</as-relative-time>
2025-12-18T13:00 <as-relative-time>2025-12-18T13:00</as-relative-time>
2025-12-18T13:00
<as-relative-time>2025-12-18T13:00</as-relative-time>
2025-12-18T13:00 <as-relative-time notime>2025-12-18T13:00</as-relative-time>
Properties (4)
Property name Description Type
datetime Optional: date & time can be inserted as attribute value. string
notime Optional: when present date time value displays only date part. string
update Optional: numeric value in minutes on how often relative time text should update with a new value. Omitted means no relative time updates. number
disabled Optional: when attribute is present actual date is displayed as default. Users can still click on the component to get relative time value. none
Files