diff --git a/src/js/bootstrap-datetimepicker.js b/src/js/bootstrap-datetimepicker.js
index <HASH>..<HASH> 100644
--- a/src/js/bootstrap-datetimepicker.js
+++ b/src/js/bootstrap-datetimepicker.js
@@ -110,7 +110,7 @@ THE SOFTWARE.
                     }
                 }
             }
-            picker.use24hours = (picker.format.toLowerCase().indexOf('a') < 1 && picker.format.indexOf('h') < 1);
+            picker.use24hours = (picker.format.toLowerCase().indexOf('a') < 0 && picker.format.indexOf('h') < 0);
 
             if (picker.component) {
                 icon = picker.component.find('span');
Fixed comparison

We're looking for cases where 'a', 'A' and 'h' are not in the format string. They can be in first position so need to check for 'not found', i.e. `<0` or `-1`.