diff options
author | 崖鹰 <zhao.wuz@alipay.com> | 2015-11-19 15:12:48 +0800 |
---|---|---|
committer | 崖鹰 <zhao.wuz@alipay.com> | 2015-11-19 15:12:48 +0800 |
commit | 6e682d895a29c9a1000f7ad5fc9821ca3915fb8e (patch) | |
tree | 0b7a1683ec1f1d97ac65560838086f0fa191fcf8 /examples/pick-time.js | |
parent | c09a8a345410454173131c6c3cab1e33cf6e8d7d (diff) | |
download | time-picker-6e682d895a29c9a1000f7ad5fc9821ca3915fb8e.tar.gz time-picker-6e682d895a29c9a1000f7ad5fc9821ca3915fb8e.tar.zst time-picker-6e682d895a29c9a1000f7ad5fc9821ca3915fb8e.zip |
Updates
Diffstat (limited to 'examples/pick-time.js')
-rw-r--r-- | examples/pick-time.js | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/examples/pick-time.js b/examples/pick-time.js index fdf4851..5fc95cf 100644 --- a/examples/pick-time.js +++ b/examples/pick-time.js | |||
@@ -28337,7 +28337,7 @@ webpackJsonp([0,1],[ | |||
28337 | } | 28337 | } |
28338 | 28338 | ||
28339 | if (value) { | 28339 | if (value) { |
28340 | if (hourOptions.indexOf(value.fields[4]) < 0 || minuteOptions.indexOf(value.fields[5]) < 0 || secondOptions.indexOf(value.fields[6]) < 0) { | 28340 | if (hourOptions.indexOf(value.getHourOfDay()) < 0 || minuteOptions.indexOf(value.getMinutes()) < 0 || secondOptions.indexOf(value.getSeconds()) < 0) { |
28341 | this.setState({ | 28341 | this.setState({ |
28342 | invalid: true | 28342 | invalid: true |
28343 | }); | 28343 | }); |
@@ -28345,7 +28345,7 @@ webpackJsonp([0,1],[ | |||
28345 | } | 28345 | } |
28346 | 28346 | ||
28347 | if (originalValue && value) { | 28347 | if (originalValue && value) { |
28348 | if (originalValue.fields[4] !== value.fields[4] || originalValue.fields[5] !== value.fields[5] || originalValue.fields[6] !== value.fields[6]) { | 28348 | if (originalValue.getHourOfDay() !== value.getHourOfDay() || originalValue.getMinutes() !== value.getMinutes() || originalValue.getSeconds() !== value.getSeconds()) { |
28349 | onChange(value); | 28349 | onChange(value); |
28350 | } | 28350 | } |
28351 | } else if (originalValue !== value) { | 28351 | } else if (originalValue !== value) { |
@@ -28457,13 +28457,13 @@ webpackJsonp([0,1],[ | |||
28457 | var value = _props.value; | 28457 | var value = _props.value; |
28458 | var onChange = _props.onChange; | 28458 | var onChange = _props.onChange; |
28459 | 28459 | ||
28460 | var index = 4; | 28460 | if (type === 'hour') { |
28461 | if (type === 'minute') { | 28461 | value.setHourOfDay(itemValue); |
28462 | index = 5; | 28462 | } else if (type === 'minute') { |
28463 | } else if (type === 'second') { | 28463 | value.setMinutes(itemValue); |
28464 | index = 6; | 28464 | } else { |
28465 | value.setSeconds(itemValue); | ||
28465 | } | 28466 | } |
28466 | value.fields[index] = itemValue; | ||
28467 | onChange(value); | 28467 | onChange(value); |
28468 | }, | 28468 | }, |
28469 | 28469 | ||
@@ -28528,14 +28528,12 @@ webpackJsonp([0,1],[ | |||
28528 | var prefixCls = _props5.prefixCls; | 28528 | var prefixCls = _props5.prefixCls; |
28529 | var value = _props5.value; | 28529 | var value = _props5.value; |
28530 | 28530 | ||
28531 | var timeFields = value.fields; | ||
28532 | |||
28533 | return _react2['default'].createElement( | 28531 | return _react2['default'].createElement( |
28534 | 'div', | 28532 | 'div', |
28535 | { className: prefixCls + '-combobox' }, | 28533 | { className: prefixCls + '-combobox' }, |
28536 | this.getHourSelect(timeFields[4]), | 28534 | this.getHourSelect(value.getHourOfDay()), |
28537 | this.getMinuteSelect(timeFields[5]), | 28535 | this.getMinuteSelect(value.getMinutes()), |
28538 | this.getSectionSelect(timeFields[6]) | 28536 | this.getSectionSelect(value.getSeconds()) |
28539 | ); | 28537 | ); |
28540 | } | 28538 | } |
28541 | }); | 28539 | }); |