diff options
Diffstat (limited to 'src/TimePicker.jsx')
-rw-r--r-- | src/TimePicker.jsx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 3e331f1..fb855e2 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -34,9 +34,10 @@ const Picker = React.createClass({ | |||
34 | style: PropTypes.object, | 34 | style: PropTypes.object, |
35 | className: PropTypes.string, | 35 | className: PropTypes.string, |
36 | showSecond: PropTypes.bool, | 36 | showSecond: PropTypes.bool, |
37 | hourOptions: PropTypes.array, | 37 | disabledHours: PropTypes.array, |
38 | minuteOptions: PropTypes.array, | 38 | disabledMinutes: PropTypes.array, |
39 | secondOptions: PropTypes.array, | 39 | disabledSeconds: PropTypes.array, |
40 | hideDisabledOptions: PropTypes.bool, | ||
40 | onChange: PropTypes.func, | 41 | onChange: PropTypes.func, |
41 | onOpen: PropTypes.func, | 42 | onOpen: PropTypes.func, |
42 | onClose: PropTypes.func, | 43 | onClose: PropTypes.func, |
@@ -54,6 +55,10 @@ const Picker = React.createClass({ | |||
54 | allowEmpty: true, | 55 | allowEmpty: true, |
55 | showHour: true, | 56 | showHour: true, |
56 | showSecond: true, | 57 | showSecond: true, |
58 | disabledHours: null, | ||
59 | disabledMinutes: null, | ||
60 | disabledSeconds: null, | ||
61 | hideDisabledOptions: false, | ||
57 | placement: 'bottomLeft', | 62 | placement: 'bottomLeft', |
58 | onChange: noop, | 63 | onChange: noop, |
59 | onOpen: noop, | 64 | onOpen: noop, |
@@ -145,7 +150,7 @@ const Picker = React.createClass({ | |||
145 | }, | 150 | }, |
146 | 151 | ||
147 | getPanelElement() { | 152 | getPanelElement() { |
148 | const { prefixCls, defaultValue, locale, placeholder, hourOptions, minuteOptions, secondOptions, allowEmpty, showHour, showSecond, gregorianCalendarLocale, value } = this.props; | 153 | const { prefixCls, defaultValue, locale, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond, gregorianCalendarLocale, value } = this.props; |
149 | let calendarLocale; | 154 | let calendarLocale; |
150 | if (value) { | 155 | if (value) { |
151 | calendarLocale = value.locale; | 156 | calendarLocale = value.locale; |
@@ -170,9 +175,10 @@ const Picker = React.createClass({ | |||
170 | allowEmpty={allowEmpty} | 175 | allowEmpty={allowEmpty} |
171 | formatter={this.getFormatter()} | 176 | formatter={this.getFormatter()} |
172 | placeholder={placeholder} | 177 | placeholder={placeholder} |
173 | hourOptions={hourOptions} | 178 | disabledHours={disabledHours} |
174 | minuteOptions={minuteOptions} | 179 | disabledMinutes={disabledMinutes} |
175 | secondOptions={secondOptions} | 180 | disabledSeconds={disabledSeconds} |
181 | hideDisabledOptions={hideDisabledOptions} | ||
176 | /> | 182 | /> |
177 | ); | 183 | ); |
178 | }, | 184 | }, |