gijgo
gijgo copied to clipboard
add showOnFocus for timepicker
showOnFocus is supported for datepicker but not for timepicker. I hacked around and set $timepicker.open() whenever I focus on input box. Issue is clock opens but it is unstable and fluctuates between hour and minutes. When I click on the dedicated button then clock opens fine.
var timeEl = $(" .timepicker").timepicker({
uiLibrary: "bootstrap4",
format: "h:MM tt",
modal: true,
mode: "ampm"
});
$(" .timepicker").on("focus", function(e) {
$(this).blur();
timeEl.open();
});
$('.timepicker').on('focus', function() { $(this).siblings('.input-group-append').click(); });
i tried this & working fine. But i have another doubt, if i have 2 inputs and tries to select one timepicker to change it updates both the inputs! , what should we do for that ??