]> git.immae.eu Git - github/fretlink/time-picker.git/blobdiff - src/Combobox.jsx
Fixed lowercased AM/PM handling
[github/fretlink/time-picker.git] / src / Combobox.jsx
index 00f122f357131ac4ada00df20594c5b62493a5a8..36b61cca13712b78fe33f1977823daa8d5d5c815 100644 (file)
@@ -55,12 +55,13 @@ const Combobox = React.createClass({
     } else if (type === 'minute') {
       value.minute(+itemValue);
     } else if (type === 'ampm') {
+      const ampm = itemValue.toUpperCase();
       if (use12Hours) {
-        if (itemValue === 'PM' && value.hour() < 12) {
+        if (ampm === 'PM' && value.hour() < 12) {
           value.hour((value.hour() % 12) + 12);
         }
 
-        if (itemValue === 'AM') {
+        if (ampm === 'AM') {
           if (value.hour() >= 12) {
             value.hour(value.hour() - 12);
           }