3.7.5 • Published 2 years ago

rc-time-picker-date-fns-format-ja v3.7.5

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

TimePicker

React TimePicker

date-fnsベースのtimepickerをforkして、午前, 午後表記に対応したもの。 format="a h:mm", formatLocale="ja"を付与すればいい。

NPM version node version npm download

example

Usage

import TimePicker from 'rc-time-picker-date-fns-format-ja';
import ReactDOM from 'react-dom';
import 'rc-time-picker-date-fns-format-ja/assets/index.css';
ReactDOM.render(<TimePicker />, container);

change from "AM, PM" to "午前, 午後".

import TimePicker from 'rc-time-picker-date-fns-format-ja';
import ReactDOM from 'react-dom';
import 'rc-time-picker-date-fns-format-ja/assets/index.css';
ReactDOM.render(<TimePicker format="a h:mm" formatLocale="ja" />, container);

API

TimePicker

NameTypeDefaultDescription
prefixClsString'rc-time-picker-date-fns-format-ja'prefixCls of this component
clearTextString'clear'clear tooltip of icon
disabledBooleanfalsewhether picker is disabled
allowEmptyBooleantrueallow clearing text
openBooleanfalsecurrent open state of picker. controlled prop
defaultValueDatenulldefault initial value
defaultOpenValueDatenew Datedefault open panel value, used to set utcOffset,locale if value/defaultValue absent
valueDatenullcurrent value
placeholderString''time input's placeholder
classNameString''time picker className
idString''time picker id
popupClassNameString''time panel className
popupStyleobject{}customize popup style
showHourBooleantruewhether show hour
showMinuteBooleantruewhether show minute
showSecondBooleantruewhether show second
formatString-date-fns format
formatLocaleString''ja
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
onAmPmChangeFunctionnullcalled when select an am/pm 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 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'
transitionNameString''
nameString-sets the name of the generated input
onOpenFunction({ open })when TimePicker panel is closed
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
inputIconReactNodespecific the select icon.
clearIconReactNodespecific the clear icon.

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-time-picker-date-fns-format-ja is released under the MIT license.