A time picker for react webapp
npm install @ashwinthomas/react-time-picker-dropdown``shell`
$ npm install --save @ashwinthomas/react-time-picker-dropdown
`javascript
import TimePicker from '@ashwinthomas/react-time-picker-dropdown';
render() {
useTwelveHourFormat={true}
onTimeChange={handleTimeChange}
/>
}
`
Displays an input field along with a dropdown to select time.
| Prop name | Description | Default value | Example values |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- | --------------------------------------------------------------------------------------------------- |
| defaultValue | Sets default input value supports formats hh:mm:ss a and hh:mm:ss | null | "10:10:00 am" |"00 : 00 : 00"
| placeholder | Can be used to set input placeholder | | "hh : mm : ss" |useTwelveHourFormat
| useTwelveHourFormat | Use props to switch between 24 / 12 hour format | false | true |null
| onTimeChange | Function called when user picks a time. (Returns if the input value is invalid.) | n/a | (value)=>alert("Time selected is: ", value) |showCloseIcon
| onInputChange | Function called when picker value changed using the dropdown | n/a | (value)=>alert("Display time changed: ", value) |
| showCloseIcon | can be used to toggle close icon visibility | true | true |showClockIcon
| showClockIcon | can be used to toggle clock icon visibility | true | true |allowBackdrop
| allowBackdrop | can be used to toggle backdrop | false | false` |