chore: update relativeTime stories

This commit is contained in:
Marc-Roig 2023-06-28 11:52:18 +02:00
parent 4ad16d5dcd
commit c48b1efc7a
No known key found for this signature in database
GPG Key ID: FB4E2C43A0BEE249

View File

@ -10,13 +10,18 @@ import RelativeTime from './index';
This component is used to display a timestamp relative to the current time.
You can display a custom message for given time intervals by passing an array of custom intervals.
## Usage
<Canvas>
<Story name="base">
<Main>
Strapi first commit was <RelativeTime timestamp={new Date('2015-10-01')} />.<br />
Christmas 2050 is <RelativeTime timestamp={new Date('2050-12-25')} />.
Christmas 2050 is <RelativeTime
timestamp={new Date('2050-12-25')}
customIntervals={[{ unit: 'days', threshold: 1, text: 'today' }]}
/>.
</Main>
</Story>
</Canvas>