modlinltd / django-advanced-filters

Add advanced filtering abilities to Django admin
https://pypi.org/project/django-advanced-filters/
MIT License
771 stars 173 forks source link

Datepicker doesn't seem to work on Django 1.6 #30

Open JVanloofsvelt opened 8 years ago

JVanloofsvelt commented 8 years ago

From the console: TypeError: $(...).datepicker is not a function

asfaltboy commented 8 years ago

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 😊

JVanloofsvelt commented 8 years ago

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

nkonin commented 7 years ago

Same problem with Django 1.8, Django CMS and Django CMS Admin Style (no Grappelli).

nkonin commented 7 years ago

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

asfaltboy commented 7 years ago

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:

Pull requests are welcome