3.3.2 • Published 6 years ago

erelevance-time-picker v3.3.2

Weekly downloads
215
License
-
Repository
github
Last release
6 years ago

TimePicker

This is a fork of React TimePicker that supports changes they refused to add to master.

NPM version build status Test coverage gemnasium deps node version npm download

example

http://react-component.github.io/time-picker/

install

npm install rc-time-picker

Usage

import TimePicker from 'rc-time-picker';
import ReactDOM from 'react-dom';
ReactDOM.render(<TimePicker />, container);

API

TimePicker

NameTypeDefaultDescription
prefixClsString'rc-time-picker'prefixCls of this component
clearTextString'clear'clear tooltip of icon
disabledBooleanfalsewhether picker is disabled
allowEmptyBooleantrueallow clearing text
openBooleanfalsecurrent open state of picker. controlled prop
defaultValuemomentnulldefault initial value
defaultOpenValuemomentmoment()default open panel value, used to set utcOffset,locale if value/defaultValue absent
valuemomentnullcurrent value
placeholderString''time input's placeholder
classNameString''time picker className
popupClassNameString''time panel className
showHourBooleantruewhether show hour
showMinuteBooleantruewhether show minute
showSecondBooleantruewhether show second
formatString-moment format
disabledHoursFunction-disabled hour options
disabledMinutesFunction-disabled minute options
disabledSecondsFunction-disabled second options
use12HoursBooleanfalse12 hours display mode
hideDisabledOptionsBooleanfalsewhether hide disabled options
onChangeFunctionnullcalled when select a different value
addonFunction-called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like panel.close().
placementStringbottomLeftone of 'left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'
transitionNameString''
nameString-sets the name of the generated input
onOpenFunction({ open })when TimePicker panel is opened
onCloseFunction({ open })when TimePicker panel is opened
hourStepNumber1interval between hours in picker
minuteStepNumber1interval between minutes in picker
secondStepNumber1interval between seconds in picker
focusOnOpenBooleanfalseautomatically focus the input when the picker opens
inputReadOnlyBooleanfalseset input to read only

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-time-picker is released under the MIT license.