react-datetime-ago
v1.0.5
Published
react-datetime-ago
Downloads
3
Readme
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
.