aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Combobox.jsx9
-rw-r--r--tests/Select.spec.jsx2
2 files changed, 4 insertions, 7 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 }
diff --git a/tests/Select.spec.jsx b/tests/Select.spec.jsx
index fb58145..ea0a827 100644
--- a/tests/Select.spec.jsx
+++ b/tests/Select.spec.jsx
@@ -446,7 +446,7 @@ describe('Select', () => {
446 Simulate.click(selector.getElementsByTagName('li')[0]); 446 Simulate.click(selector.getElementsByTagName('li')[0]);
447 setTimeout(next, 200); 447 setTimeout(next, 200);
448 }, (next) => { 448 }, (next) => {
449 expect((input).value).to.be('12:00 pm'); 449 expect((input).value).to.be('12:00 am');
450 next(); 450 next();
451 }], () => { 451 }], () => {
452 done(); 452 done();