onEsc: PropTypes.func,
allowEmpty: PropTypes.bool,
showHour: PropTypes.bool,
+ showMinute: PropTypes.bool,
showSecond: PropTypes.bool,
onClear: PropTypes.func,
+ use12Hours: PropTypes.bool,
+ addon: PropTypes.func,
},
getDefaultProps() {
disabledMinutes: noop,
disabledSeconds: noop,
defaultOpenValue: moment(),
+ use12Hours: false,
+ addon: noop,
};
},
this.setState({ currentSelectPanel });
},
+ close() {
+ this.props.onEsc();
+ },
+
render() {
const {
prefixCls, className, placeholder, disabledHours, disabledMinutes,
- disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond,
- format, defaultOpenValue, clearText, onEsc,
+ disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond,
+ format, defaultOpenValue, clearText, onEsc, addon, use12Hours,
} = this.props;
const {
value, currentSelectPanel,
const secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions);
return (
- <div className={classNames({ [`${prefixCls}-inner`]: true, [className]: className })}>
+ <div className={classNames({ [`${prefixCls}-inner`]: true, [className]: !!className })}>
<Header
clearText={clearText}
prefixCls={prefixCls}
format={format}
onChange={this.onChange}
showHour={showHour}
+ showMinute={showMinute}
showSecond={showSecond}
hourOptions={hourOptions}
minuteOptions={minuteOptions}
disabledMinutes={disabledMinutes}
disabledSeconds={disabledSeconds}
onCurrentSelectPanelChange={this.onCurrentSelectPanelChange}
+ use12Hours={use12Hours}
/>
+ {addon(this)}
</div>
);
},