react-timepick
v0.3.2
Published
<b>Demo: <a href="https://vladop.github.io/react-timepick/examples/index.html">https://vladop.github.io/react-timepick/examples/index.html</a> </b>
Downloads
14
Readme
react-timepick
Demo: https://vladop.github.io/react-timepick/examples/index.html
Get started by npm i react-timepick
Javascript:
const TimePick=require('react-timepick');
const TimePicker=TimePick.TimePicker;
const TimeInterval=TimePick.TimeInterval;
or:
import {TimePicker} from 'react-timepick'
TimeInterval is just typescript interface for allowedIntervals prop
CSS
For default styling pull css from dist folder:
<link rel="stylesheet" type="text/css" href="node_modules/react-timepick/dist/timepicker.css">
You can use it like this:
render(){
<TimePicker time={"12:20"} id="timePicker1" minuteStep={15} onTimeChange={this.onTimeChange}/>
}
Props
| Name | Type | Default | Description | Optional | ------------- |:--------------:| ----------------:| ------------------------------------------:| ---------:| | id | String | no-default| Unique id for each datepicker | No | | time | String | no-default| Time for timePicker (in hh:mm format| No | | onTimeChange | Function({ newTime }) | | Callback executed whenever times change | No | | minuteStep | number | no-default | Step in minutes between two choices | No |