Skip to content

fix datetime format for Django 5 - #1648

Open
griffin-h wants to merge 3 commits into
TOMToolkit:devfrom
griffin-h:datetime_format
Open

fix datetime format for Django 5#1648
griffin-h wants to merge 3 commits into
TOMToolkit:devfrom
griffin-h:datetime_format

Conversation

@griffin-h

Copy link
Copy Markdown
Contributor

Django 5 dropped support for specifying date formats in the settings file. This is the recommended workaround, e.g., https://www.loopwerk.io/articles/2025/django-i18n-date-formats/.

@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Aug 18, 2026
@jchate6
jchate6 requested review from Fingel and phycodurus August 18, 2026 00:57
@jchate6 jchate6 added the bug Something isn't working label Aug 18, 2026
@jchate6 jchate6 added this to the Griffin's PRs and Issues milestone Aug 18, 2026
@jchate6 jchate6 added the User Issue Raised by a user label Aug 18, 2026
@jchate6
jchate6 requested a review from phycodurus August 25, 2026 20:38

@Fingel Fingel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only be applied to the en locale. Which might be fine. I'm curious, is there a way to override all locale's formats to the one we were using? I think that would be consistent with the desired behavior from before.

@griffin-h

Copy link
Copy Markdown
Contributor Author

This will only be applied to the en locale. Which might be fine. I'm curious, is there a way to override all locale's formats to the one we were using? I think that would be consistent with the desired behavior from before.

This is a good point, but I have no idea how to do it!

@Fingel

Fingel commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This is a good point, but I have no idea how to do it!

I did some digging myself and I don't think there is a way. I think we just accept that if the TOM developer changes the locale to something other than en-us then they get whatever datetime format is set for their locale. Which might be the desired outcome, anyway. Though I assume the defaults for other languages are just as "unscientific" as the one we are overriding here.

The real fix here is not to place bare {{ times }} in templates and explicitly format them with a constant, defined in settings. So like DATETIME_FORMAT but called something else so we aren't shadowing a deprecated setting. That's a whole other issue and chunk of work though. I think this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working User Issue Raised by a user

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

4 participants