archlinux / archweb

Arch Linux website code
https://archlinux.org
GNU General Public License v2.0
317 stars 128 forks source link

ISO 8601 date format #520

Open micwoj92 opened 1 month ago

micwoj92 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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/

nl6720 commented 2 weeks ago

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 commented 2 weeks ago

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.