From dd275f7df354e218d170ddbcc1eadff1427db76b Mon Sep 17 00:00:00 2001 From: Antony Shaleynikov Date: Thu, 2 Mar 2017 11:02:45 +0300 Subject: show12Hours prop was renamed to use12Hours --- src/Combobox.jsx | 18 +++++++++--------- src/Panel.jsx | 8 ++++---- src/TimePicker.jsx | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/Combobox.jsx b/src/Combobox.jsx index e31b7fd..339764c 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx @@ -35,15 +35,15 @@ const Combobox = React.createClass({ disabledMinutes: PropTypes.func, disabledSeconds: PropTypes.func, onCurrentSelectPanelChange: PropTypes.func, - show12Hours: PropTypes.bool, + use12Hours: PropTypes.bool, }, onItemChange(type, itemValue) { - const { onChange, defaultOpenValue, show12Hours } = this.props; + const { onChange, defaultOpenValue, use12Hours } = this.props; const value = (this.props.value || defaultOpenValue).clone(); if (type === 'hour') { - if (show12Hours) { + if (use12Hours) { if (value.hour() > 12 || !value.hour()) { value.hour(+itemValue + 12); } else { @@ -55,7 +55,7 @@ const Combobox = React.createClass({ } else if (type === 'minute') { value.minute(+itemValue); } else if (type === 'ampm') { - if (show12Hours) { + if (use12Hours) { if (itemValue === 'PM' && value.hour() <= 12) { value.hour(value.hour() + 12); } @@ -80,13 +80,13 @@ const Combobox = React.createClass({ }, getHourSelect(hour) { - const { prefixCls, hourOptions, disabledHours, showHour, show12Hours } = this.props; + const { prefixCls, hourOptions, disabledHours, showHour, use12Hours } = this.props; if (!showHour) { return null; } const disabledOptions = disabledHours(); let hourAdj; - if (show12Hours) { + if (use12Hours) { if (hour > 12) { hourAdj = hour - 12; } else { @@ -97,7 +97,7 @@ const Combobox = React.createClass({ } let hourOptionsAdj; - if (show12Hours) { + if (use12Hours) { hourOptionsAdj = hourOptions.filter(h => h <= 12 && h > 0); } else { hourOptionsAdj = hourOptions; @@ -156,8 +156,8 @@ const Combobox = React.createClass({ }, getAMPMSelect() { - const { prefixCls, show12Hours, defaultOpenValue } = this.props; - if (!show12Hours) { + const { prefixCls, use12Hours, defaultOpenValue } = this.props; + if (!use12Hours) { return null; } const value = this.props.value || defaultOpenValue; diff --git a/src/Panel.jsx b/src/Panel.jsx index d02bd01..df128ff 100644 --- a/src/Panel.jsx +++ b/src/Panel.jsx @@ -37,7 +37,7 @@ const Panel = React.createClass({ showMinute: PropTypes.bool, showSecond: PropTypes.bool, onClear: PropTypes.func, - show12Hours: PropTypes.bool, + use12Hours: PropTypes.bool, addon: PropTypes.func, }, @@ -50,7 +50,7 @@ const Panel = React.createClass({ disabledMinutes: noop, disabledSeconds: noop, defaultOpenValue: moment(), - show12Hours: false, + use12Hours: false, addon: noop, }; }, @@ -92,7 +92,7 @@ const Panel = React.createClass({ const { prefixCls, className, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, - format, defaultOpenValue, clearText, onEsc, addon, show12Hours, + format, defaultOpenValue, clearText, onEsc, addon, use12Hours, } = this.props; const { value, currentSelectPanel, @@ -142,7 +142,7 @@ const Panel = React.createClass({ disabledMinutes={disabledMinutes} disabledSeconds={disabledSeconds} onCurrentSelectPanelChange={this.onCurrentSelectPanelChange} - show12Hours={show12Hours} + use12Hours={use12Hours} /> {addon(this)} diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index f73d2b1..6b76223 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -43,7 +43,7 @@ const Picker = React.createClass({ addon: PropTypes.func, name: PropTypes.string, autoComplete: PropTypes.string, - show12Hours: PropTypes.bool, + use12Hours: PropTypes.bool, }, getDefaultProps() { @@ -68,7 +68,7 @@ const Picker = React.createClass({ onOpen: noop, onClose: noop, addon: noop, - show12Hours: false, + use12Hours: false, }; }, @@ -144,7 +144,7 @@ const Picker = React.createClass({ prefixCls, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, - addon, show12Hours, + addon, use12Hours, } = this.props; return ( ); -- cgit v1.2.3