RelativeDateTime
Provides a relative date string for resolutions ranging from seconds up through years. Should be used when absolute date and time is unnecessarily specific.
Examples
We can pass a date as either an ISO 8601 string, a Date object, or a UNIX Epoch time.
Passing a baseDate
Normally, the component compares your date
with today’s date. If you want to compare it to some specific date
you need to provide baseDate
prop.
The component will display in a day
Using isRelativeToCurrentWeek
You can set isRelativeToCurrentWeek to true if you want to indicate that the date is relative only within a week.
And if the difference is more than one week, just show the date without relativeness.
It will compare the date to today or baseDate
if provided.