diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Combobox.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Combobox.jsx b/src/Combobox.jsx index 1eed4d2..19fbd19 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx | |||
@@ -83,12 +83,20 @@ class Combobox extends Component { | |||
83 | if (!showHour) { | 83 | if (!showHour) { |
84 | return null; | 84 | return null; |
85 | } | 85 | } |
86 | const disabledOptions = disabledHours(); | 86 | let disabledOptions = disabledHours(); |
87 | let hourOptionsAdj; | 87 | let hourOptionsAdj; |
88 | let hourAdj; | 88 | let hourAdj; |
89 | if (use12Hours) { | 89 | if (use12Hours) { |
90 | hourOptionsAdj = [12].concat(hourOptions.filter(h => h < 12 && h > 0)); | 90 | hourOptionsAdj = [12].concat(hourOptions.filter(h => h < 12 && h > 0)); |
91 | hourAdj = (hour % 12) || 12; | 91 | hourAdj = (hour % 12) || 12; |
92 | |||
93 | if (Array.isArray(disabledOptions)) { | ||
94 | if (this.isAM()) { | ||
95 | disabledOptions = disabledOptions.filter(h => h < 12).map(h => (h === 0 ? 12 : h)); | ||
96 | } else { | ||
97 | disabledOptions = disabledOptions.map(h => (h === 12 ? 12 : h - 12)); | ||
98 | } | ||
99 | } | ||
92 | } else { | 100 | } else { |
93 | hourOptionsAdj = hourOptions; | 101 | hourOptionsAdj = hourOptions; |
94 | hourAdj = hour; | 102 | hourAdj = hour; |