A package for counter hours input. Works in milliseconds or in clasical format HH:MM:SS.
npm install @teinorsa/react-timeinputmillisecondsToFormat which get time in MS as param and return HH:MM:SS
formatToMilliseconds which get as params hours, minutes, seconds and return ms
sh
$ npm install --save @teinorsa/react-timeinput
`
$3
`sh
import ReactTimeInput from '@teinorsa/react-timeinput';
...
`
$3
Dillinger is currently extended with the following plugins. Instructions on how to use them in your own application are linked below.
| prop | type | default
| ------ | ------ | ------ |
| divKey | string or number | 1
| inputProps | object (here can be name, onChange...) | {}
| renderHours | boolean | true
| renderMinutes | boolean | true
| renderSeconds | boolean | true
| defaultValue | string (milliseconds or HH:MM:SS) | ''
| worksInMilliseconds | boolean | true
| styled | boolean | false
| onChange | function (return val with MS or HH:MM:SS depending worksInMilliseconds) | false
Examples
#### Example 1
#### Code
`sh
import React from 'react';
import './App.css';
import ReactTimeInput from '@teinorsa/react-timeinput';
function App() {
return (
);
}
export default App;
`
#### Result
!ResulteExample1
#### Example 2
#### Code
`sh
import React from 'react';
import './App.css';
import ReactTimeInput from '@teinorsa/react-timeinput';
function App() {
return (
divKey={1}
defaultValue='35:40:13'
worksInMilliseconds={false}
renderSeconds={false}
inputProps={{name: 'mytimeinput', id: 'myid'}}
/>
);
}
export default App;
``