Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateFilter based on the wagtail-datepicker #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

murray3k
Copy link

I created a DateFilter using Wagtail's datepicker implementation.

Backend code

Backend code works like the django/wagtail form fields and widgets. Its uses mostly the same code to parse and output dates from strings and vice versa.
Beware: date-time-chooser.js is always injected into media of the view, but I didn't saw any harm in doing that.

Frontend code

Frontend is a bit messy (see: useEffect hook in components/filters/date.js), because there seems to be an error in wagtail's onGenerate function. It breaks with a custom date format. I replicated the functionality and it seems to works fine. But you never know ... Ye old ~3000 line jquery.datetimepicker.js is a bit intimidating :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant