react-datetime-ago

1.0.5 • Public • Published

React DateTime Ago

React DateTime Ago npm package is used to show date and time in formatted way. e.g 1 min ago , 20 days ago, 1 month ago, 2 years ago.

Authors

Installation

To install react datetime ago npm package

  npm i react-datetime-ago

Usage/Examples

import React from 'react'
import {TimeAgo} from 'react-datetime-ago'

const App = () => {
  return (
        <TimeAgo 
          date="Wed, 31 Jan 2024 08:18:48 +0000" // TimeStamp is not supported
        />
  )
}

export default App
  

Result

Result after execution of above code

  20 hours ago

API Reference

TimeAgo Api Reference

Props Type Default Description
date datetime none pass the date

Contributing

Contributions are always welcome!

Please adhere to this project's code of conduct.

Readme

Keywords

Package Sidebar

Install

npm i react-datetime-ago

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

6.44 kB

Total Files

9

Last publish

Collaborators

  • adminmart