Skip to content

johndavedecano/react-simple-timeago

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Simple TimeAgo

A very simple time ago component for ReactJS

Installation

yarn add react-simple-timeago --save
#or
npm install react-simple-timeago --save

Usage

import TimeAgo from 'react-simple-timeago';

<TimeAgo date={new Date()} />

Properties

  • 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

Further Help

Contact me on Codementor

About

A very simple time ago component for ReactJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published