1.1.1 • Published 5 years ago
react-pretty-duration v1.1.1
react-pretty-duration
react-pretty-duration is a reactjs package converting numbered duration to user friendly duration text.
Installation
Use the npm to install react-pretty-duration.
npm install react-pretty-durationUsage
import React from 'react';
import PrettyDuration from 'react-pretty-duration';
const App = () => {
	return (
		// provide total minutes
		<PrettyDuration duration={200} />
	)
}
// result => 3hr 20minDemo
Props
| props | type | default | description | required | 
|---|---|---|---|---|
| duration | number | 0 | numbered duration in minutes, must be greater than 0 | true | 
| className | string | 0 | className for element styling | false | 
| style | style object | 0 | object for inline styling | false | 
Notice
This package uses react hooks, so would works with react@16.8 or greater
License
MIT