react-simple-timeago

1.0.1 • Public • Published

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

Dependencies (2)

Dev Dependencies (4)

Package Sidebar

Install

npm i react-simple-timeago

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • jdecano