Closed dobromir-hristov closed 7 years ago
Same bug for me.
was just about to post this
I also have this bug !
Curious to know if it was caused maybe by this PR? https://github.com/Laravel-Backpack/CRUD/pull/408/commits/987f2d5644c851486387b2a21e8613271301cfa8
If you guys could reverse the change made in that commit, and see if it fixes it, then we know the culprit
Hi @OwenMelbz, Thanks for your answer. I made those changes and also tested your last fix. The datepicker works fine but if I have an address field (with the autocomplete), this field doesn't works anymore.
Same problem here, and yes if I revert #408 it works
I have a similar issue. 'date' type works fine but when i use 'date_picker' (even when copy pasted from docs) chrome and firefox throws this error:
TypeError: $(...).datepicker is not a function[Learn More]
Have you tried this ? https://github.com/Laravel-Backpack/CRUD/pull/159#issuecomment-282491621
I had mentioned this error as PR in the Base Repo. https://github.com/Laravel-Backpack/Base/pull/110 jQuery ui is not loaded.
Adding the jquery ui fixed it for me.
@skatika, yes. But it needs to be a part of the Base. And I've made the PR. But no response.
Well, this goes a little deeper.
First of all, the absence of jQuery UI is not the real issue here.
This all comes down to a bug in Bootstrap Datepicker which has been fixed since Oct 14, 2014.
As Backpack depends on AdminLTE (and its plugins) and AdminLTE uses outdated version of the Bootstrap Datepicker (issue already opened - https://github.com/almasaeed2010/AdminLTE/issues/1462) we're stuck with the buggy version right now.
I'm definitely against including jQuery UI as a fix for this issue, since it's not the right solution.
The question is, how to fix it?
@OwenMelbz @tabacitu - what's your strategy for stuff like this (outdated packages in dependencies)? Should we add our own separate version of said package (Bootstrap Datepicker in this case) and use that one, or should we wait for fix in AdminLTE and use some kind of workaround for now?
As for the workaround (or call it a hot-fix), the best I came up with is to change the #408 to:
if (jQuery.ui) {
var datepicker = $.fn.datepicker.noConflict();
$.fn.bootstrapDP = datepicker;
} else {
$.fn.bootstrapDP = $.fn.datepicker;
}
It isn't ideal, since jQuery UI is not necessarily the only package causing conflicts here, but it's the only one that we know of right now.
@pavoltanuska , I love your reply, and I completely agree with your temporary fix. Would merge it right away if you can submit a PR.
I can't say I have "a strategy" for outdated packages in dependencies, but:
Cheers!
Alright, thanks for the insights and of course for all the work done @tabacitu !
I'll keep an eye on the AdminLTE's take on this issue and will let you guys know once it's fixed.
That would be great, thank you!
Just merged your PR, so let's close this bad boy. Cheers!
I can not used datetimepicker on mac os Is I used Modal BS. datetimepicker display background modal Help Me.
@kanyapila-101 - at the very minimum we'd need to know if your debug console showed any errors (especially missing files, actual error logs and so forth) and a basic idea of your setup.
As it's not obviously related to this issue, it might be best to open another issue and start there.
If it relates to this issue we can always reference it back to here later.
As the title says it, I get this
$(...).datepicker not defined
error, but I have published all the configs and should have the vendors and everything. The datepicker.js script is loaded as well. Laravel 5.4, with latest versions of Base/Cruds etc.