aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--src/Combobox.jsx18
-rw-r--r--src/Panel.jsx8
-rw-r--r--src/TimePicker.jsx8
4 files changed, 19 insertions, 19 deletions
diff --git a/README.md b/README.md
index b9d06fd..d8a35b9 100644
--- a/README.md
+++ b/README.md
@@ -60,13 +60,13 @@ API
60| value | moment | null | current value | 60| value | moment | null | current value |
61| placeholder | String | '' | time input's placeholder | 61| placeholder | String | '' | time input's placeholder |
62| showHour | Boolean | whether show hour | | 62| showHour | Boolean | whether show hour | |
63| showMinute | Boolean | whether show minute | | 63| showMinute | Boolean | whether show minute | |
64| showSecond | Boolean | whether show second | | 64| showSecond | Boolean | whether show second | |
65| format | String | | | 65| format | String | | |
66| disabledHours | Function | disabled hour options | | 66| disabledHours | Function | disabled hour options | |
67| disabledMinutes | Function | disabled minute options | | 67| disabledMinutes | Function | disabled minute options | |
68| disabledSeconds | Function | disabled second options | | 68| disabledSeconds | Function | disabled second options | |
69| show12Hours | Boolean | 12 hours display mode | | 69| use12Hours | Boolean | 12 hours display mode | |
70| hideDisabledOptions | Boolean | whether hide disabled options | | 70| hideDisabledOptions | Boolean | whether hide disabled options | |
71| onChange | Function | null | called when select a different value | 71| onChange | Function | null | called when select a different value |
72| 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| 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()`.|
diff --git a/src/Combobox.jsx b/src/Combobox.jsx
index e31b7fd..339764c 100644
--- a/src/Combobox.jsx
+++ b/src/Combobox.jsx
@@ -35,15 +35,15 @@ const Combobox = React.createClass({
35 disabledMinutes: PropTypes.func, 35 disabledMinutes: PropTypes.func,
36 disabledSeconds: PropTypes.func, 36 disabledSeconds: PropTypes.func,
37 onCurrentSelectPanelChange: PropTypes.func, 37 onCurrentSelectPanelChange: PropTypes.func,
38 show12Hours: PropTypes.bool, 38 use12Hours: PropTypes.bool,
39 }, 39 },
40 40
41 onItemChange(type, itemValue) { 41 onItemChange(type, itemValue) {
42 const { onChange, defaultOpenValue, show12Hours } = this.props; 42 const { onChange, defaultOpenValue, use12Hours } = this.props;
43 const value = (this.props.value || defaultOpenValue).clone(); 43 const value = (this.props.value || defaultOpenValue).clone();
44 44
45 if (type === 'hour') { 45 if (type === 'hour') {
46 if (show12Hours) { 46 if (use12Hours) {
47 if (value.hour() > 12 || !value.hour()) { 47 if (value.hour() > 12 || !value.hour()) {
48 value.hour(+itemValue + 12); 48 value.hour(+itemValue + 12);
49 } else { 49 } else {
@@ -55,7 +55,7 @@ const Combobox = React.createClass({
55 } else if (type === 'minute') { 55 } else if (type === 'minute') {
56 value.minute(+itemValue); 56 value.minute(+itemValue);
57 } else if (type === 'ampm') { 57 } else if (type === 'ampm') {
58 if (show12Hours) { 58 if (use12Hours) {
59 if (itemValue === 'PM' && value.hour() <= 12) { 59 if (itemValue === 'PM' && value.hour() <= 12) {
60 value.hour(value.hour() + 12); 60 value.hour(value.hour() + 12);
61 } 61 }
@@ -80,13 +80,13 @@ const Combobox = React.createClass({
80 }, 80 },
81 81
82 getHourSelect(hour) { 82 getHourSelect(hour) {
83 const { prefixCls, hourOptions, disabledHours, showHour, show12Hours } = this.props; 83 const { prefixCls, hourOptions, disabledHours, showHour, use12Hours } = this.props;
84 if (!showHour) { 84 if (!showHour) {
85 return null; 85 return null;
86 } 86 }
87 const disabledOptions = disabledHours(); 87 const disabledOptions = disabledHours();
88 let hourAdj; 88 let hourAdj;
89 if (show12Hours) { 89 if (use12Hours) {
90 if (hour > 12) { 90 if (hour > 12) {
91 hourAdj = hour - 12; 91 hourAdj = hour - 12;
92 } else { 92 } else {
@@ -97,7 +97,7 @@ const Combobox = React.createClass({
97 } 97 }
98 98
99 let hourOptionsAdj; 99 let hourOptionsAdj;
100 if (show12Hours) { 100 if (use12Hours) {
101 hourOptionsAdj = hourOptions.filter(h => h <= 12 && h > 0); 101 hourOptionsAdj = hourOptions.filter(h => h <= 12 && h > 0);
102 } else { 102 } else {
103 hourOptionsAdj = hourOptions; 103 hourOptionsAdj = hourOptions;
@@ -156,8 +156,8 @@ const Combobox = React.createClass({
156 }, 156 },
157 157
158 getAMPMSelect() { 158 getAMPMSelect() {
159 const { prefixCls, show12Hours, defaultOpenValue } = this.props; 159 const { prefixCls, use12Hours, defaultOpenValue } = this.props;
160 if (!show12Hours) { 160 if (!use12Hours) {
161 return null; 161 return null;
162 } 162 }
163 const value = this.props.value || defaultOpenValue; 163 const value = this.props.value || defaultOpenValue;
diff --git a/src/Panel.jsx b/src/Panel.jsx
index d02bd01..df128ff 100644
--- a/src/Panel.jsx
+++ b/src/Panel.jsx
@@ -37,7 +37,7 @@ const Panel = React.createClass({
37 showMinute: PropTypes.bool, 37 showMinute: PropTypes.bool,
38 showSecond: PropTypes.bool, 38 showSecond: PropTypes.bool,
39 onClear: PropTypes.func, 39 onClear: PropTypes.func,
40 show12Hours: PropTypes.bool, 40 use12Hours: PropTypes.bool,
41 addon: PropTypes.func, 41 addon: PropTypes.func,
42 }, 42 },
43 43
@@ -50,7 +50,7 @@ const Panel = React.createClass({
50 disabledMinutes: noop, 50 disabledMinutes: noop,
51 disabledSeconds: noop, 51 disabledSeconds: noop,
52 defaultOpenValue: moment(), 52 defaultOpenValue: moment(),
53 show12Hours: false, 53 use12Hours: false,
54 addon: noop, 54 addon: noop,
55 }; 55 };
56 }, 56 },
@@ -92,7 +92,7 @@ const Panel = React.createClass({
92 const { 92 const {
93 prefixCls, className, placeholder, disabledHours, disabledMinutes, 93 prefixCls, className, placeholder, disabledHours, disabledMinutes,
94 disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, 94 disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond,
95 format, defaultOpenValue, clearText, onEsc, addon, show12Hours, 95 format, defaultOpenValue, clearText, onEsc, addon, use12Hours,
96 } = this.props; 96 } = this.props;
97 const { 97 const {
98 value, currentSelectPanel, 98 value, currentSelectPanel,
@@ -142,7 +142,7 @@ const Panel = React.createClass({
142 disabledMinutes={disabledMinutes} 142 disabledMinutes={disabledMinutes}
143 disabledSeconds={disabledSeconds} 143 disabledSeconds={disabledSeconds}
144 onCurrentSelectPanelChange={this.onCurrentSelectPanelChange} 144 onCurrentSelectPanelChange={this.onCurrentSelectPanelChange}
145 show12Hours={show12Hours} 145 use12Hours={use12Hours}
146 /> 146 />
147 {addon(this)} 147 {addon(this)}
148 </div> 148 </div>
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx
index f73d2b1..6b76223 100644
--- a/src/TimePicker.jsx
+++ b/src/TimePicker.jsx
@@ -43,7 +43,7 @@ const Picker = React.createClass({
43 addon: PropTypes.func, 43 addon: PropTypes.func,
44 name: PropTypes.string, 44 name: PropTypes.string,
45 autoComplete: PropTypes.string, 45 autoComplete: PropTypes.string,
46 show12Hours: PropTypes.bool, 46 use12Hours: PropTypes.bool,
47 }, 47 },
48 48
49 getDefaultProps() { 49 getDefaultProps() {
@@ -68,7 +68,7 @@ const Picker = React.createClass({
68 onOpen: noop, 68 onOpen: noop,
69 onClose: noop, 69 onClose: noop,
70 addon: noop, 70 addon: noop,
71 show12Hours: false, 71 use12Hours: false,
72 }; 72 };
73 }, 73 },
74 74
@@ -144,7 +144,7 @@ const Picker = React.createClass({
144 prefixCls, placeholder, disabledHours, 144 prefixCls, placeholder, disabledHours,
145 disabledMinutes, disabledSeconds, hideDisabledOptions, 145 disabledMinutes, disabledSeconds, hideDisabledOptions,
146 allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, 146 allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText,
147 addon, show12Hours, 147 addon, use12Hours,
148 } = this.props; 148 } = this.props;
149 return ( 149 return (
150 <Panel 150 <Panel
@@ -166,7 +166,7 @@ const Picker = React.createClass({
166 disabledMinutes={disabledMinutes} 166 disabledMinutes={disabledMinutes}
167 disabledSeconds={disabledSeconds} 167 disabledSeconds={disabledSeconds}
168 hideDisabledOptions={hideDisabledOptions} 168 hideDisabledOptions={hideDisabledOptions}
169 show12Hours={show12Hours} 169 use12Hours={use12Hours}
170 addon={addon} 170 addon={addon}
171 /> 171 />
172 ); 172 );