aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/module/Panel.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/module/Panel.jsx')
-rw-r--r--src/module/Panel.jsx19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/module/Panel.jsx b/src/module/Panel.jsx
index 12d23f7..94d3842 100644
--- a/src/module/Panel.jsx
+++ b/src/module/Panel.jsx
@@ -24,9 +24,9 @@ const Panel = React.createClass({
24 placeholder: PropTypes.string, 24 placeholder: PropTypes.string,
25 gregorianCalendarLocale: PropTypes.object, 25 gregorianCalendarLocale: PropTypes.object,
26 formatter: PropTypes.object, 26 formatter: PropTypes.object,
27 disabledHours: PropTypes.array, 27 disabledHours: PropTypes.func,
28 disabledMinutes: PropTypes.array, 28 disabledMinutes: PropTypes.func,
29 disabledSeconds: PropTypes.array, 29 disabledSeconds: PropTypes.func,
30 hideDisabledOptions: PropTypes.bool, 30 hideDisabledOptions: PropTypes.bool,
31 onChange: PropTypes.func, 31 onChange: PropTypes.func,
32 onEsc: PropTypes.func, 32 onEsc: PropTypes.func,
@@ -40,10 +40,6 @@ const Panel = React.createClass({
40 40
41 getDefaultProps() { 41 getDefaultProps() {
42 return { 42 return {
43 disabledHours: null,
44 disabledMinutes: null,
45 disabledSeconds: null,
46 hideDisabledOptions: false,
47 onChange: noop, 43 onChange: noop,
48 onClear: noop, 44 onClear: noop,
49 }; 45 };
@@ -81,9 +77,12 @@ const Panel = React.createClass({
81 render() { 77 render() {
82 const { locale, prefixCls, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond, formatter, gregorianCalendarLocale } = this.props; 78 const { locale, prefixCls, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond, formatter, gregorianCalendarLocale } = this.props;
83 const value = this.state.value; 79 const value = this.state.value;
84 const hourOptions = generateOptions(24, disabledHours, hideDisabledOptions); 80 const disabledHourOptions = disabledHours();
85 const minuteOptions = generateOptions(60, disabledMinutes, hideDisabledOptions); 81 const disabledMinuteOptions = disabledMinutes(value.getHourOfDay());
86 const secondOptions = generateOptions(60, disabledSeconds, hideDisabledOptions); 82 const disabledSecondOptions = disabledSeconds(value.getHourOfDay(), value.getMinutes());
83 const hourOptions = generateOptions(24, disabledHourOptions, hideDisabledOptions);
84 const minuteOptions = generateOptions(60, disabledMinuteOptions, hideDisabledOptions);
85 const secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions);
87 86
88 return ( 87 return (
89 <div className={`${prefixCls}-inner`}> 88 <div className={`${prefixCls}-inner`}>