aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Combobox.jsx
diff options
context:
space:
mode:
authorAntony Shaleynikov <shaleynikov@gmail.com>2017-03-02 11:02:45 +0300
committerAntony Shaleynikov <shaleynikov@gmail.com>2017-03-02 11:02:45 +0300
commitdd275f7df354e218d170ddbcc1eadff1427db76b (patch)
tree0dc5b9efdd7def8be8ab857ae9c75c0bf302e2cd /src/Combobox.jsx
parentf8e59df8666ee32ae769f35cd01b4de4d4e4bed1 (diff)
downloadtime-picker-dd275f7df354e218d170ddbcc1eadff1427db76b.tar.gz
time-picker-dd275f7df354e218d170ddbcc1eadff1427db76b.tar.zst
time-picker-dd275f7df354e218d170ddbcc1eadff1427db76b.zip
show12Hours prop was renamed to use12Hours
Diffstat (limited to 'src/Combobox.jsx')
-rw-r--r--src/Combobox.jsx18
1 files changed, 9 insertions, 9 deletions
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;