django-unfold icon indicating copy to clipboard operation
django-unfold copied to clipboard

RangeDateFilter does not send ISO date format in query

Open VaZark opened this issue 8 months ago • 4 comments

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 avatar Jun 17 '24 12:06 VaZark