diff options
author | Antony Shaleynikov <shaleynikov@gmail.com> | 2017-03-06 13:01:07 +0300 |
---|---|---|
committer | Antony Shaleynikov <shaleynikov@gmail.com> | 2017-03-06 13:01:07 +0300 |
commit | c1b40cabff82ed1b7a24fd9baf74e7a8e64119e5 (patch) | |
tree | 1fe4183914bdf82275144f5515a265f4127f4e71 /src | |
parent | eb3c19e2cd2e11cec1eed9337ce44a312b3fc60b (diff) | |
download | time-picker-c1b40cabff82ed1b7a24fd9baf74e7a8e64119e5.tar.gz time-picker-c1b40cabff82ed1b7a24fd9baf74e7a8e64119e5.tar.zst time-picker-c1b40cabff82ed1b7a24fd9baf74e7a8e64119e5.zip |
Fixed lowercased AM/PM handling
Diffstat (limited to 'src')
-rw-r--r-- | src/Combobox.jsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Combobox.jsx b/src/Combobox.jsx index 00f122f..36b61cc 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx | |||
@@ -55,12 +55,13 @@ 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 | const ampm = itemValue.toUpperCase(); | ||
58 | if (use12Hours) { | 59 | if (use12Hours) { |
59 | if (itemValue === 'PM' && value.hour() < 12) { | 60 | if (ampm === 'PM' && value.hour() < 12) { |
60 | value.hour((value.hour() % 12) + 12); | 61 | value.hour((value.hour() % 12) + 12); |
61 | } | 62 | } |
62 | 63 | ||
63 | if (itemValue === 'AM') { | 64 | if (ampm === 'AM') { |
64 | if (value.hour() >= 12) { | 65 | if (value.hour() >= 12) { |
65 | value.hour(value.hour() - 12); | 66 | value.hour(value.hour() - 12); |
66 | } | 67 | } |