#35306: Improve documentation for the various date format settings
-------------------------------------+-------------------------------------
Reporter: Richard | Owner: Lufafa
Type: | Joshua
Cleanup/optimization | Status: assigned
Component: | Version: 5.0
Internationalization |
Severity: Normal | Resolution:
Keywords: LANGUAGE_CODE, | Triage Stage: Accepted
DATE_FORMAT |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):
Replying to [comment:11 Claude Paroz]:
> Replying to [comment:6 Natalia Bidart]:
> > (Another data point: even using `{% localize off %}` does not honor
the settings values. This feels unexpected to me...)
>
> Are you sure? This [https://github.com/claudep/django/commit/57f9982
passing test] seems to show the contrary. Could you double-check?
I am sure, but with a caveat :-)
I have double checked and in my manual tests, I was explicitly passing the
`|date` template filter. So, basically, if we add this case to your test
(I renamed your original `date` to `my_date` for clarity):
{{{#!python
date_plus_tag_template = Template(
"{% load l10n %}Localized: {{ my_date|date }}. {% localize off
%}Unlocalized: "
"{{ my_date|date }}{% endlocalize %}."
)
}}}
There is this test failure:
{{{
AssertionError: 'Localized: 15. Dezember 2024. Unlocalized: 15. Dezember
2024.' != 'Localized: 15. Dezember 2024. Unlocalized: 15-12-2024.'
}}}
Using `my_date|date:'DATE_FORMAT'` also makes the test fails. For example,
a valid use case for explicitly wanting to pipe `date` to a given context
provided date would be to truncate a datetime to date .
--
Ticket URL: <https://code.djangoproject.com/ticket/35306#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018e75c06fac-6f09ade5-5455-4e83-9774-927d07874a42-000000%40eu-central-1.amazonses.com.