Whencomponent

When(props: WhenProps): ReactElement
ParamType
propsWhenProps
Props for When, Ago, and Until — a target date plus an optional current reference date and full toggle. required
    .targetPossibleDate
Values that can be converted to dates.
    .currentPossibleDate
Reference date the relative time is measured against. Defaults to "now"
    .fullboolean
Return
ReactElement
Rendered <time> element showing the relative time.
Throws
RequiredError
If target (or current) cannot be coerced to a valid date.

Relative time — shows a signed string like in 6d or 3w ago wrapped in a <time> element carrying the machine-readable date.

Examples

<When target="2030-01-01" />