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

RangeDateFilter does not send ISO date format in query #491

Open
VaZark opened this issue Jun 17, 2024 · 1 comment
Open

RangeDateFilter does not send ISO date format in query #491

VaZark opened this issue Jun 17, 2024 · 1 comment

Comments

@VaZark
Copy link

VaZark commented Jun 17, 2024

I noticed that the RangeDate filters do not work and the results fetched apply only the other filters.

After some digging, it looks like the widget and the query send DD/MM/YYYY instead of the YYYY-MM-DD. This in turn throws an exception ValidationError(['Le format de la valeur «\xa004/06/2024\xa0» n’est pas valide. Le format correct est AAAA-MM-JJ HH:MM[:ss[.uuuuuu]][FH].'])

Manually entering the date in the ISO Format in the input seems to work fine

Fix: Update the query string set to the input to respect the ISO Format (maybe use type="date"?)

@VaZark
Copy link
Author

VaZark commented Jun 17, 2024

Adding "type"="date" makes the widget functional again but we lose the pretty calendar dialog

widget=forms.DateInput(
attrs={
"placeholder": _("From"),
"class": "vCustomDateField " + " ".join(INPUT_CLASSES),
}
),
)

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

No branches or pull requests

1 participant