Nestable Processes Mutate
Learn how companies like Phone2Action are using npm in their front-end developmentJoin the conversation »

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

Install

npm i react-simple-timeago

DownloadsWeekly Downloads

7

Version

1.0.1

License

ISC

Last publish

Collaborators

  • avatar