aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
author偏右 <afc163@gmail.com>2017-02-20 16:02:11 +0800
committerGitHub <noreply@github.com>2017-02-20 16:02:11 +0800
commit66c7bc36856bbabb4ff73a3ccf671448eed1f359 (patch)
treed06f2e3b8e267c242863d10bb983352440ca00b7
parentfa912931fa6952cf85fe4b35bd15cd83f3e32876 (diff)
parentee6394229b2340c70c342851ecf5dba3462ac4ef (diff)
downloadtime-picker-66c7bc36856bbabb4ff73a3ccf671448eed1f359.tar.gz
time-picker-66c7bc36856bbabb4ff73a3ccf671448eed1f359.tar.zst
time-picker-66c7bc36856bbabb4ff73a3ccf671448eed1f359.zip
Merge branch 'master' into fix-ref-error
-rw-r--r--.travis.yml2
-rw-r--r--README.md1
-rw-r--r--src/TimePicker.jsx8
3 files changed, 8 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index e780b32..d2c1fdb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,7 +7,7 @@ notifications:
7 - yiminghe@gmail.com 7 - yiminghe@gmail.com
8 8
9node_js: 9node_js:
10- 4.0.0 10- 6
11 11
12before_install: 12before_install:
13- | 13- |
diff --git a/README.md b/README.md
index 05182c2..4a36815 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,7 @@ API
71| addon | Function | nothing | called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like `panel.close()`.| 71| addon | Function | nothing | called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like `panel.close()`.|
72| placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] | 72| placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] |
73| transitionName | String | '' | | 73| transitionName | String | '' | |
74| name | String | nothing | sets the name of the generated input |
74 75
75 76
76## Test Case 77## Test Case
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx
index 28857a0..da47ac4 100644
--- a/src/TimePicker.jsx
+++ b/src/TimePicker.jsx
@@ -41,6 +41,7 @@ const Picker = React.createClass({
41 onOpen: PropTypes.func, 41 onOpen: PropTypes.func,
42 onClose: PropTypes.func, 42 onClose: PropTypes.func,
43 addon: PropTypes.func, 43 addon: PropTypes.func,
44 name: PropTypes.string,
44 }, 45 },
45 46
46 getDefaultProps() { 47 getDefaultProps() {
@@ -188,7 +189,7 @@ const Picker = React.createClass({
188 const { 189 const {
189 prefixCls, placeholder, placement, align, 190 prefixCls, placeholder, placement, align,
190 disabled, transitionName, style, className, showHour, 191 disabled, transitionName, style, className, showHour,
191 showMinute, showSecond, getPopupContainer, 192 showMinute, showSecond, getPopupContainer, name,
192 } = this.props; 193 } = this.props;
193 const { open, value } = this.state; 194 const { open, value } = this.state;
194 let popupClassName; 195 let popupClassName;
@@ -213,7 +214,10 @@ const Picker = React.createClass({
213 <span className={`${prefixCls} ${className}`} style={style}> 214 <span className={`${prefixCls} ${className}`} style={style}>
214 <input 215 <input
215 className={`${prefixCls}-input`} 216 className={`${prefixCls}-input`}
216 ref={this.saveInputRef} type="text" placeholder={placeholder} 217 ref={this.saveInputRef}
218 type="text"
219 placeholder={placeholder}
220 name={name}
217 readOnly 221 readOnly
218 onKeyDown={this.onKeyDown} 222 onKeyDown={this.onKeyDown}
219 disabled={disabled} value={value && value.format(this.getFormat()) || ''} 223 disabled={disabled} value={value && value.format(this.getFormat()) || ''}