mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
chore: update relativeTime stories
This commit is contained in:
parent
4ad16d5dcd
commit
c48b1efc7a
@ -10,13 +10,18 @@ import RelativeTime from './index';
|
|||||||
|
|
||||||
This component is used to display a timestamp relative to the current time.
|
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
|
## Usage
|
||||||
|
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<Story name="base">
|
<Story name="base">
|
||||||
<Main>
|
<Main>
|
||||||
Strapi first commit was <RelativeTime timestamp={new Date('2015-10-01')} />.<br />
|
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>
|
</Main>
|
||||||
</Story>
|
</Story>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user