A component for rendering a datetime using an HTML5
<time>element. It supports just about any display format supported by moment as well as auto-updating on a set interval.
<Time datetime="now" format="LLLL" />
<Time datetime={createdAt} from="now" refresh="1s" />
<Time datetime={createdAt} calendar="now" />This determines the date/time to display. Anything accepted by moment is supported, and the value "now" is treated as a special case. (by excluding the attribute altogether, "now" is assumed)
If passed, this will render the datetime using format().
If passed, this will render the datetime using from(date). (anything accepted by moment is supported)
The value "now" is treated as a special case. (and will use fromNow() instead)
If passed, this will render the datetime using to(date). (anything accepted by moment is supported)
The value "now" is treated as a special case. (and will use toNow() instead)
If passed, this will render the datetime using calendar(date). (anything accepted by moment is supported)
The value "now" is treated as a special case.
If passed, the component will auto-update on the given interval. Generally, this is useful when displaying relative times so that the displayed value doesn't become stale.
Used to extend the <time> element with your own CSS hooks. (passed to magic-virtual-element)