Skip to content

hd-relative-time

Live preview

Motion <hd-relative-time datetime="{{ cap.alarm_motion.lastUpdated }}"></hd-relative-time>

Attributes and example

hd-relative-time

Time since a moment, kept up to date (“4 min ago”).

AttributeWhat it is
datetimerequiredISO timestamp.
Motion <hd-relative-time datetime="{{ cap.alarm_motion.lastUpdated }}"></hd-relative-time>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

No component-specific CSS variables are exposed. Use the host element’s sizing and the documented theme variables.

Style the host

hd-relative-time {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables