diff options
Diffstat (limited to 'examples/value-and-defaultValue.js')
-rw-r--r-- | examples/value-and-defaultValue.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/examples/value-and-defaultValue.js b/examples/value-and-defaultValue.js index b83e799..4c295a6 100644 --- a/examples/value-and-defaultValue.js +++ b/examples/value-and-defaultValue.js | |||
@@ -35,21 +35,17 @@ webpackJsonp([3],{ | |||
35 | 35 | ||
36 | var _gregorianCalendarFormat2 = _interopRequireDefault(_gregorianCalendarFormat); | 36 | var _gregorianCalendarFormat2 = _interopRequireDefault(_gregorianCalendarFormat); |
37 | 37 | ||
38 | var _gregorianCalendarLibLocaleZh_CN = __webpack_require__(168); | 38 | var _rcTimePicker = __webpack_require__(168); |
39 | |||
40 | var _gregorianCalendarLibLocaleZh_CN2 = _interopRequireDefault(_gregorianCalendarLibLocaleZh_CN); | ||
41 | |||
42 | var _rcTimePicker = __webpack_require__(169); | ||
43 | 39 | ||
44 | var _rcTimePicker2 = _interopRequireDefault(_rcTimePicker); | 40 | var _rcTimePicker2 = _interopRequireDefault(_rcTimePicker); |
45 | 41 | ||
46 | var _rcTimePickerSrcLocaleZh_CN = __webpack_require__(228); | 42 | var _rcTimePickerSrcLocaleZh_CN = __webpack_require__(227); |
47 | 43 | ||
48 | var _rcTimePickerSrcLocaleZh_CN2 = _interopRequireDefault(_rcTimePickerSrcLocaleZh_CN); | 44 | var _rcTimePickerSrcLocaleZh_CN2 = _interopRequireDefault(_rcTimePickerSrcLocaleZh_CN); |
49 | 45 | ||
50 | var formatter = new _gregorianCalendarFormat2['default']('HH:mm:ss'); | 46 | var formatter = new _gregorianCalendarFormat2['default']('HH:mm:ss'); |
51 | 47 | ||
52 | var now = new _gregorianCalendar2['default'](_gregorianCalendarLibLocaleZh_CN2['default']); | 48 | var now = new _gregorianCalendar2['default'](_rcTimePickerSrcLocaleZh_CN2['default'].calendar); |
53 | now.setTime(Date.now()); | 49 | now.setTime(Date.now()); |
54 | 50 | ||
55 | var App = _react2['default'].createClass({ | 51 | var App = _react2['default'].createClass({ |
@@ -64,6 +60,11 @@ webpackJsonp([3],{ | |||
64 | console.log(value && formatter.format(value)); | 60 | console.log(value && formatter.format(value)); |
65 | this.setState({ value: value }); | 61 | this.setState({ value: value }); |
66 | }, | 62 | }, |
63 | clear: function clear() { | ||
64 | this.setState({ | ||
65 | value: undefined | ||
66 | }); | ||
67 | }, | ||
67 | render: function render() { | 68 | render: function render() { |
68 | return _react2['default'].createElement( | 69 | return _react2['default'].createElement( |
69 | 'div', | 70 | 'div', |
@@ -72,7 +73,12 @@ webpackJsonp([3],{ | |||
72 | defaultValue: now }), | 73 | defaultValue: now }), |
73 | _react2['default'].createElement(_rcTimePicker2['default'], { formatter: formatter, locale: _rcTimePickerSrcLocaleZh_CN2['default'], | 74 | _react2['default'].createElement(_rcTimePicker2['default'], { formatter: formatter, locale: _rcTimePickerSrcLocaleZh_CN2['default'], |
74 | value: this.state.value, | 75 | value: this.state.value, |
75 | onChange: this.handleValueChange }) | 76 | onChange: this.handleValueChange }), |
77 | _react2['default'].createElement( | ||
78 | 'button', | ||
79 | { onClick: this.clear }, | ||
80 | 'clear' | ||
81 | ) | ||
76 | ); | 82 | ); |
77 | } | 83 | } |
78 | }); | 84 | }); |