@tamalweb/use-time-ago
v1.0.0
Published
React hook to get time ago or time since current time (time ago).
Downloads
4
Maintainers
Readme
@tamal3053/use-time-ago
React hook for time since current time in readable format. React Time Ago Custom Hook.
Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.
You'll need to install
react
,react-dom
, etc at^16.7.0-alpha.0
Install
yarn add tamal3053/use-time-ago
Usage
import useTimeAgo from 'tamal3053/use-time-ago';
function MyComponent() {
return useTimeAgo( new Date() - 360000 ); // 6 minutes ago
}