#35333: Template tag `unlocalize` does not work with `date` and `time` filters.
---------------------------------+----------------------------------------
Reporter: Natalia Bidart | Owner: Claude Paroz
Type: Bug | Status: assigned
Component: Template system | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Comment (by Claude Paroz):
I'm not yet sure if this can be resolved in the code, or if we should
rather complement the template filter docs, telling that if you apply an
l10n-sensible filter inside an unlocalized section, you should specify an
explicit format argument. The problem being that the way filters are
currently implemented, it's not possible to transmit any context. That
explains for example that `floatformat` gained an `u` parameter to force
unlocalization (see #30086).
So in your example in the tests above, you should use
`|date:settings.DATE_FORMAT` and not just `DATE_FORMAT`. Thoughts?
--
Ticket URL: <
https://code.djangoproject.com/ticket/35333#comment:1>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.