mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 11:54:10 +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.
 | 
			
		||||
 | 
			
		||||
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>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user