diff options
author | 偏右 <afc163@gmail.com> | 2016-11-11 14:02:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-11 14:02:21 +0800 |
commit | e59f4eae17cbfd7eed19cd385ec64312ffe266c4 (patch) | |
tree | 81fc9b6ec28ca54204cf6ed2ef035b5d7ee194ab /src/Combobox.jsx | |
parent | 614f6c90232d890984d0f4f2f13ff41fdb144b27 (diff) | |
parent | 37c36c09e0a4d693a2ec5623ff2ebc8d9ee16a06 (diff) | |
download | time-picker-e59f4eae17cbfd7eed19cd385ec64312ffe266c4.tar.gz time-picker-e59f4eae17cbfd7eed19cd385ec64312ffe266c4.tar.zst time-picker-e59f4eae17cbfd7eed19cd385ec64312ffe266c4.zip |
Merge pull request #25 from react-component/feat-show-minute
Feat show minute
Diffstat (limited to 'src/Combobox.jsx')
-rw-r--r-- | src/Combobox.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Combobox.jsx b/src/Combobox.jsx index 9d9da16..013617c 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx | |||
@@ -26,6 +26,7 @@ const Combobox = React.createClass({ | |||
26 | value: PropTypes.object, | 26 | value: PropTypes.object, |
27 | onChange: PropTypes.func, | 27 | onChange: PropTypes.func, |
28 | showHour: PropTypes.bool, | 28 | showHour: PropTypes.bool, |
29 | showMinute: PropTypes.bool, | ||
29 | showSecond: PropTypes.bool, | 30 | showSecond: PropTypes.bool, |
30 | hourOptions: PropTypes.array, | 31 | hourOptions: PropTypes.array, |
31 | minuteOptions: PropTypes.array, | 32 | minuteOptions: PropTypes.array, |
@@ -73,7 +74,10 @@ const Combobox = React.createClass({ | |||
73 | }, | 74 | }, |
74 | 75 | ||
75 | getMinuteSelect(minute) { | 76 | getMinuteSelect(minute) { |
76 | const { prefixCls, minuteOptions, disabledMinutes, defaultOpenValue } = this.props; | 77 | const { prefixCls, minuteOptions, disabledMinutes, defaultOpenValue, showMinute } = this.props; |
78 | if (!showMinute) { | ||
79 | return null; | ||
80 | } | ||
77 | const value = this.props.value || defaultOpenValue; | 81 | const value = this.props.value || defaultOpenValue; |
78 | const disabledOptions = disabledMinutes(value.hour()); | 82 | const disabledOptions = disabledMinutes(value.hour()); |
79 | 83 | ||