aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/module/Combobox.jsx
diff options
context:
space:
mode:
authorMG12 <wuzhao.mail@gmail.com>2015-12-16 16:45:08 +0800
committerMG12 <wuzhao.mail@gmail.com>2015-12-16 16:45:08 +0800
commitaed96fd625c23d720f0f4a684c1fcd62b7399be7 (patch)
treec0d56577959323b8cb89704135f25c39f0e0bfb3 /src/module/Combobox.jsx
parent1370f11cb101e4cf3eef1dedd501e8c9d954ab3c (diff)
downloadtime-picker-aed96fd625c23d720f0f4a684c1fcd62b7399be7.tar.gz
time-picker-aed96fd625c23d720f0f4a684c1fcd62b7399be7.tar.zst
time-picker-aed96fd625c23d720f0f4a684c1fcd62b7399be7.zip
fixed bugs when value empty.
Diffstat (limited to 'src/module/Combobox.jsx')
-rw-r--r--src/module/Combobox.jsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/module/Combobox.jsx b/src/module/Combobox.jsx
index 7374b39..f1e7c5b 100644
--- a/src/module/Combobox.jsx
+++ b/src/module/Combobox.jsx
@@ -79,7 +79,8 @@ const Combobox = React.createClass({
79 }, 79 },
80 80
81 getMinuteSelect(minute) { 81 getMinuteSelect(minute) {
82 const { prefixCls, minuteOptions, disabledMinutes, value } = this.props; 82 const { prefixCls, minuteOptions, disabledMinutes } = this.props;
83 const value = this.props.value || this.getNow();
83 const disabledOptions = disabledMinutes(value.getHourOfDay()); 84 const disabledOptions = disabledMinutes(value.getHourOfDay());
84 85
85 return ( 86 return (
@@ -95,10 +96,11 @@ const Combobox = React.createClass({
95 }, 96 },
96 97
97 getSecondSelect(second) { 98 getSecondSelect(second) {
98 const { prefixCls, secondOptions, disabledSeconds, showSecond, value } = this.props; 99 const { prefixCls, secondOptions, disabledSeconds, showSecond } = this.props;
99 if (!showSecond) { 100 if (!showSecond) {
100 return null; 101 return null;
101 } 102 }
103 const value = this.props.value || this.getNow();
102 const disabledOptions = disabledSeconds(value.getHourOfDay(), value.getMinutes()); 104 const disabledOptions = disabledSeconds(value.getHourOfDay(), value.getMinutes());
103 105
104 return ( 106 return (