Open pnaw94 opened 7 years ago
I am having same issues as-well, i have to use [data-provide]
I would suggest to add the datepickerPlugin
as $.datepickerPlugin
, but do this for the moment:
$('[data-provide="datepicker-inline"]:not([datepicker-binded])').each(function () {
$(this).attr('datepicker-binded', true); // for pjax
var config = JSON.parse($(this).attr('data-datepicker-options'));
if (!$.isPlainObject(config)) {
config = {};
}
var dp = $(this).data('datepicker');
if ('_process_options' in dp) {
dp._process_options($.extend({}, config, {autoclose: true}));
}
});
I'm using both jQuery UI and bootstrap-datepicker. All the dependencies are loaded automatically, and I don't have any room for manual scripting in-between to assign those to some variables.
The problem is that jQuery UI's datepicker replaces bootstrap-datepicker (the $.fn.datepicker variable), so that I can not set additional languages (and I need to add some other than the ones shipped with datepicker distribution).
There's this answer: https://github.com/uxsolutions/bootstrap-datepicker/issues/1694, although I can't really see how this is any helpful, since on page load jQuery UI already replaces $.fn.datepicker, I also have no access to $.fn.datepicker.noConflict method.
Is there something I'm missing, or maybe another way to access bootstrap-datepicker?