Datepicker doesn't seem to work on Django 1.6
From the console: TypeError: $(...).datepicker is not a function
Hi @elJorno,
Thank you for showing interest in django-advanced-filters and for reporting the issue!
datepicker is a component of jQuery UI. The plugin should be included if you use the django-grappelli package, but not necessarily if you don't.
This issue is somewhat similar to #2 , and you can refer to this comment for details on customizing the template and frontend behavior to your needs. Alas, toggling grappelli requirement easily is still on our TODO list.
A potential solution specific to the datepicker widget requirement, would be to default to an <input type="date"> element for the date range field value input. This will render a nice widget in Chrome and Opera, and should fallback to a simple text input on other browsers.
Thanks again, and we welcome PRs if you feel like contributing 😊
Hi @asfaltboy, thanks for your reply. I was just exploring your app but I will not be using it. If I were I might attempt to contribute (that'd be new for me :) ).
Kind regards
Same problem with Django 1.8, Django CMS and Django CMS Admin Style (no Grappelli).
It seems date range doesn't work at all without grappelli
https://github.com/modlinltd/django-advanced-filters/blob/1.0.5/advanced_filters/static/advanced-filters/advanced-filters.js#L40
Hi @nkonin , thank you for your interest in django-advanced-filters. Yes, you are correct that grappelli is currently required to use the mentioned widget.
I guess we have a few options at this time:
- Explicitly include [jQuery UI datepicker][1] and use only it in our default template.
- Use django's
AdminDateWidget/AdminTimeWidgetimplementation - Detect existing UI overhaul (e.g Grappelli) and use the included code from them
Pull requests are welcome