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

ISO 8601 date format #520

Closed
micwoj92 opened this issue Jul 22, 2024 · 6 comments · Fixed by #530 · May be fixed by #537
Closed

ISO 8601 date format #520

micwoj92 opened this issue Jul 22, 2024 · 6 comments · Fixed by #530 · May be fixed by #537
Labels

Comments

@micwoj92
Copy link

micwoj92 commented Jul 22, 2024

Hello,

Previously (up until around the outage) packages page used to show dates in ISO 8601 format as can be seen on this snapshot https://web.archive.org/web/20240718044236/https://archlinux.org/packages/
After the outage it uses month day, year format https://web.archive.org/web/20240720124233/https://archlinux.org/packages/

Was there anything changed? Could it be reverted back to ISO 8601, thanks.

@jelly jelly added the bug label Jul 23, 2024
@jelly
Copy link
Member

jelly commented Jul 23, 2024

And https://web.archive.org/web/20231204002243/https://archlinux.org/packages/extra/any/perl-test-most/ and https://archlinux.org/packages/extra/any/perl-test-most/

I don't believe this is a recent change. Maybe more something to do with Django 5.

@micwoj92
Copy link
Author

Actually it affects entire site. I will update title of the issue.

I don't know if it is new Django version. I had similar issue 2 years ago, but it went away shortly.
https://old.reddit.com/r/archlinux/comments/rknkx5/date_change_on_website/

@micwoj92 micwoj92 changed the title ISO 8601 date on https://archlinux.org/packages/ ISO 8601 date format Jul 23, 2024
@nl6720
Copy link
Member

nl6720 commented Aug 26, 2024

Quoting https://forum.djangoproject.com/t/datetime-format/30811/10:

There was a change in the docs between 4.2 and 5.0 that may explain your situation.

In 4.2, DATETIME_FORMAT:

Note that if USE_L10N is set to True , then the locale-dictated format has higher precedence and will be applied instead.

Since the USE_L10N setting was removed in 5.0 5, the docs now read:

Note that the locale-dictated format has higher precedence and will be applied instead.

(In other words, locale-defined formats always take precedence.)

This means that you either need to change the locale format, or specifically use this format in the template.

@nl6720
Copy link
Member

nl6720 commented Aug 26, 2024

I don't know what is the proper way to fix this, but replacing date:"DATETIME_FORMAT" with date:"Y-m-d H:i" works.

nl6720 added a commit to nl6720/archweb that referenced this issue Sep 28, 2024
Explicitly specify the ISO 8601 format `Y-m-d H:i` in the date template.

Django 5.0.5 removed the USE_L10N setting making the locale-specific
formats override DATE_FORMAT and DATETIME_FORMAT. See
https://forum.djangoproject.com/t/datetime-format/30811/10 for details.

Fixes archlinux#520
@jelly jelly closed this as completed in #530 Oct 1, 2024
@jelly jelly closed this as completed in b39c4c9 Oct 1, 2024
@micwoj92
Copy link
Author

Sorry for late ping @nl6720, I Must have missed email for this closure.
It is still not 100% ISO 8601 as it was. For example ood flags are not in this format:
https://archlinux.org/packages/extra/x86_64/librime/
Same with /packages and /news:
https://archlinux.org/packages
https://archlinux.org/news/

Quick search can show difference between package details and packages page:
https://github.com/search?q=repo%3Aarchlinux%2Farchweb%20pkg.build_date%7Cdate&type=code

nl6720 added a commit to nl6720/archweb that referenced this issue Dec 28, 2024
Use the `Y-m-d` format everywhere.

Fixes archlinux#520
@nl6720
Copy link
Member

nl6720 commented Dec 28, 2024

@micwoj92, see #537.

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

Successfully merging a pull request may close this issue.

3 participants