bootstrap-ui-datetime-picker icon indicating copy to clipboard operation
bootstrap-ui-datetime-picker copied to clipboard

Global TimePicker configuration not being respected (2.5.4)

Open richardwalker-iamtech opened this issue 8 years ago • 0 comments
trafficstars

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.

richardwalker-iamtech avatar Jul 31 '17 16:07 richardwalker-iamtech