A very simple time ago component for ReactJS
yarn add react-simple-timeago --save
#or
npm install react-simple-timeago --save
import TimeAgo from 'react-simple-timeago';
<TimeAgo date={new Date()} />
- element(string) - Element that will be used to wrap the time ago texts.
- date(Date, String, Number) - The given date
- className(String) - Custom class that can be applied to style the element.
- isLive(Boolean) - Tells wether you want to automatically update the component.
- addSuffix(Boolean) - Distances less than a minute are more detailed
- includeSeconds(Boolean) - Result indicates if the second date is earlier or later than the first