aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAntony Shaleynikov <shaleynikov@gmail.com>2017-03-02 16:36:33 +0300
committerAntony Shaleynikov <shaleynikov@gmail.com>2017-03-02 16:36:33 +0300
commit2a8cf5ae98a8b827e62aa20212053de6171315c9 (patch)
tree2b79ca90a76a49cb6861614d6765309c0a219429 /src
parent79405d1bc30c868cdf2c4bfb3abe654d28aeb5ca (diff)
downloadtime-picker-2a8cf5ae98a8b827e62aa20212053de6171315c9.tar.gz
time-picker-2a8cf5ae98a8b827e62aa20212053de6171315c9.tar.zst
time-picker-2a8cf5ae98a8b827e62aa20212053de6171315c9.zip
Tests and 12PM -> 12AM switching fixed
Diffstat (limited to 'src')
-rw-r--r--src/Combobox.jsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Combobox.jsx b/src/Combobox.jsx
index d2c934c..958e108 100644
--- a/src/Combobox.jsx
+++ b/src/Combobox.jsx
@@ -56,15 +56,12 @@ const Combobox = React.createClass({
56 value.minute(+itemValue); 56 value.minute(+itemValue);
57 } else if (type === 'ampm') { 57 } else if (type === 'ampm') {
58 if (use12Hours) { 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) + 12);
61 } 61 }
62 62
63 if (itemValue === 'AM') { 63 if (itemValue === 'AM') {
64 if (!value.hour()) { 64 if (value.hour() >= 12) {
65 value.hour(12);
66 } else
67 if (value.hour() > 12) {
68 value.hour(value.hour() - 12); 65 value.hour(value.hour() - 12);
69 } 66 }
70 } 67 }