bootstrap-ui-datetime-picker
bootstrap-ui-datetime-picker copied to clipboard
Global TimePicker configuration not being respected (2.5.4)
Hi,
It looks like the global time picker configuration (from plain bootstrap-ui) is not being respected when you change the showMeridian option to false. Some code in bootstrap-ui-datetime-picker looks to be overwriting the settings.
See around line 166 in dist/datetime-picker.js (or search for '// timepicker element'). It is looking to see if the scope's timepickerOptions have been set, which they are not, as I am relying on the global ones, then the code writes some (what looks like) junk into the options, which ui-bootstrap's code sees as truthy, so displays the AM/PM buttons. Or at least this is how it looked when I was stepping through both libraries in Chrome's debugger.
I have found that if I add an extra attribute to my HTML ('timepicker-options="true"') with a truthy value, then the issue is worked-around.
Please see this plunker for a simple example: https://plnkr.co/edit/CugDCh6jfPmKRTFlMoLm?p=preview
Apologies if this description does not make much sense!
Cheers, Richard.