1.0.1 • Published 6 years ago

rc-time-picker-luxon v1.0.1

Weekly downloads
45
License
MIT
Repository
github
Last release
6 years ago

TimePicker

CircleCI

Version of react-component/time-picker that uses Luxon rather than Moment.

Examples

https://robinbentley.github.io/time-picker-luxon/

Install

npm install --save rc-time-picker-luxon

Usage

// include rc-time-picker-luxon/assets/index.css however your styles are managed
import TimePicker from 'rc-time-picker-luxon';
import ReactDOM from 'react-dom';
ReactDOM.render(<TimePicker />, container);

Props

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
defaultValueDateTimenulldefault initial value
defaultOpenValueDateTimeDateTime.local()default open panel value, used to set utcOffset,locale if value/defaultValue absent
valueDateTimenullcurrent value
placeholderString''time input's placeholder
classNameString''time picker className
idString''time picker id
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 closed
hourStepNumber1interval between hours in picker
minuteStepNumber1interval between minutes in picker
secondStepNumber1interval between seconds in pickerTest Case
focusOnOpenBoolean Test Casefalseautomatically focus the input when the picker opens
inputReadOnlyBooleanfalseset input to read only
inputIconReactNodespecific the select icon.
clearIconReactNodespecific the clear icon.

Running Tests

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

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