aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--HISTORY.md5
-rw-r--r--package.json2
-rw-r--r--src/module/Combobox.jsx6
-rw-r--r--src/module/Panel.jsx4
4 files changed, 12 insertions, 5 deletions
diff --git a/HISTORY.md b/HISTORY.md
index 48c386a..f72f67a 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -2,6 +2,11 @@
2 2
3--- 3---
4 4
51.0.0-alpha9 / 2015-12-16
6------------------
7
8`fixed` update bugs when value empty.
9
51.0.0-alpha7 / 2015-12-12 101.0.0-alpha7 / 2015-12-12
6------------------ 11------------------
7 12
diff --git a/package.json b/package.json
index a8ca6ad..61aabc7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "rc-time-picker", 2 "name": "rc-time-picker",
3 "version": "1.0.0-alpha8", 3 "version": "1.0.0-alpha9",
4 "description": "React TimePicker", 4 "description": "React TimePicker",
5 "keywords": [ 5 "keywords": [
6 "react", 6 "react",
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 (
diff --git a/src/module/Panel.jsx b/src/module/Panel.jsx
index 94d3842..4c3d071 100644
--- a/src/module/Panel.jsx
+++ b/src/module/Panel.jsx
@@ -78,8 +78,8 @@ const Panel = React.createClass({
78 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;
79 const value = this.state.value; 79 const value = this.state.value;
80 const disabledHourOptions = disabledHours(); 80 const disabledHourOptions = disabledHours();
81 const disabledMinuteOptions = disabledMinutes(value.getHourOfDay()); 81 const disabledMinuteOptions = disabledMinutes(value ? value.getHourOfDay() : null);
82 const disabledSecondOptions = disabledSeconds(value.getHourOfDay(), value.getMinutes()); 82 const disabledSecondOptions = disabledSeconds(value ? value.getHourOfDay() : null, value ? value.getMinutes() : null);
83 const hourOptions = generateOptions(24, disabledHourOptions, hideDisabledOptions); 83 const hourOptions = generateOptions(24, disabledHourOptions, hideDisabledOptions);
84 const minuteOptions = generateOptions(60, disabledMinuteOptions, hideDisabledOptions); 84 const minuteOptions = generateOptions(60, disabledMinuteOptions, hideDisabledOptions);
85 const secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions); 85 const secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions);