Hyperkitty archive: date format in thread overview of list does not honor DATETIME_FORMAT of settings.py

Dear mailman community,
with the help of you I was able to set up a new mailman3 environment (a big THANK YOU!!! :-)):
OS: Ubuntu 24.04-LTS mailman: GNU Mailman 3.3.10 (Tom Sawyer) Python: 3.12.3 (main, Feb 4 2025, 14:48:35) [GCC 13.3.0] Method: Python Virtual Environment Installation
My configuration files are placed in the following directory: /etc/mailman3
- gunicorn.py
- mailman.cfg
- settings.py
The environment is up and running: A list for testing is set up and mails are transfered (and archived) using the test-list - successfully... :-)
Looking at the thread overview of the list (in Hyperkitty archives) I realized that the shown date format is unusual (for Germany), like: Do Mai 22, 3:57 nachm. (meaning: Thu May 22, 3:57 p.m.) I would prefer a format like: 22-05-2025 15:57:24
So I tried to reconfigure this setting in settings.py according to this URL: https://docs.mailman3.org/en/latest/config-web.html#configure-postorius-hype... In settings.py I set DATETIME_FORMAT to 'd-m-Y H:i:s' but the format did not change. (After changing settings.py I initiated a restart of mailman3 and mailmanweb)
I also set USE_L10N to False as suggested in Django-Docs: https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-DATETIME_FOR... My /etc/mailman3/settings.py is parsed - as far as I can say because changing USE_I18N to false (in /etc/mailman3/settings.py) switches date to English as this is my locales-setting on Ubuntu... Nevertheless the format stays the same (in this case: Thu May 22, 3:57 p.m.)
How can I adjust the date format (in the discussion boxes) at the thread overview page (url: https://my-domain.de/archives/list/test-list@lists.my-domain.de/)?
Any hint is appreciated!
Thank you very much and kind regards
Christian

Christian Schneider writes:
In settings.py I set DATETIME_FORMAT to 'd-m-Y H:i:s' but the format did not change.
I'm not sure what DATETIME_FORMAT is used for in Django 3.x. According to the docs for the 'date' and 'time' filters, they both accept a datetime object as argument, but they use DATE_FORMAT and TIME_FORMAT, respectively, to format it as a date string and a time string separately. Try
DATE_FORMAT = 'd-m-Y' TIME_FORMAT = 'H:i:s'
instead. Can't promise it will work but that's my best guess. See https://docs.djangoproject.com/en/3.1/ref/templates/builtins/#std-templatefi...
I can't figure out from the documents how you can change it when localization is enabled. I guess you have to change the localization configuration, which probably can be done from the outside the distributed source but I don't have time to search for how. So unfortunately you probably need to keep using USE_L10N = False. At least for dates that's not a big deal, only USians will be subject to confusion. Nobody else uses the insane m-d-Y convention, and in Germany even USians will probably be used to the more logical form.
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan

On 5/24/25 5:04 AM, Stephen J. Turnbull wrote:
Christian Schneider writes:
In settings.py I set DATETIME_FORMAT to 'd-m-Y H:i:s' but the format did not change.
I'm not sure what DATETIME_FORMAT is used for in Django 3.x.
I doubt the OP is using Django 3.2. I suspect the URL <https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-DATETIME_FOR...> came from a search result and the OP actually has Django 4.2 or 5.0 (django_mailman3 >= 1.3.12 requires django>=4.2,<5.1).
Note that the doc for DATETIME_FORMAT for Django >=5.0 removes the note about USE_L10N = True and says "Note that the locale-dictated format has higher precedence and will be applied instead."
Thus, with Django >= 5.0 I think the setting for DATETIME_FORMAT is ignored for output and the locale's format is used in all cases.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Hi Mark,
thank you for your reply! :-) I checked my installation and indeed I use django version 4.2.20 So I will have to configure my locales in the right way... Thank you for this clarification! :-)
But I wondered where I got off track...and I checked my track: I didn't use a search engine which pointed me to the django 3.1 docs... I was lead there while browsing the actual mailman docs! Here on this page: https://docs.mailman3.org/en/latest/config-web.html there is a link that directed me to the "old" django docs. At the bottom of this page there are mentioned two configuration options (TIME_FORMAT and DATETIME_FORMAT) The paragraphs describing the use of these options contain urls pointing to the 3.1 django docs... Maybe this page (https://docs.mailman3.org/en/latest/config-web.html) can be modified to point to a more recent version of the django docs?
Thank you very much for this awesome software and the lively usergroup!
Kind regards
Christian

On 5/26/25 3:54 AM, Christian Schneider wrote:
Maybe this page (https://docs.mailman3.org/en/latest/config-web.html) can be modified to point to a more recent version of the django docs?
I'll fix that.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Hi Mark,
I had to dive deeper in to the problem and found the reason for my problem. A short reminder of the case: As I wrote the date and time format in the thread overview was not adapted to the language setting in settings.py
This problem is related to the following issue in hyperkitty here: https://gitlab.com/mailman/hyperkitty/-/issues/357
My Mailman-installation is based on the venv-installation manual... So I fetched the packages via "pip install ..." (on Ubuntu Server 24.04-LTS)
As it seems the issue 357 of hyperkitty is not fixed in the template that came with my pip install: ....venv/lib/python3.12site-packages/hyperkitty/templates/hyperkitty/fragments/overview_threads.html Around line 16/17 "{{ thread.date_active|date:"d-m-Y, G:i" }}" (adapted to my needs, knowing that it'll be gone with the next update ;-)) a date is piped into the formatter with a fixed setting...
Although the problem should be fixed according to this url: https://gitlab.com/mailman/hyperkitty/-/blob/master/hyperkitty/templates/hyp... it persists in my relatively fresh install...Hyperkitty-1.3.12, mailman-hyperkitty-1.2.1 (According to this url https://docs.mailman3.org/en/latest/ these are the latest versions)
Is there a way to access a newer version (maybe develop-version) via pip install of Hyperkitty?
"pip index versions Hyperkitty" gives me the following output: Hyperkitty (1.3.12) Available versions: 1.3.12, 1.3.9, 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.2, 1.2.1, 1.2.0, 1.1.4, 1.1.1, 1.1.0, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.9.7, 0.9.6, 0.9.3, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1 INSTALLED: 1.3.12 LATEST: 1.3.12
Kind regards
Christian

On 5/28/25 01:45, Christian Schneider wrote:
Although the problem should be fixed according to this url: https://gitlab.com/mailman/hyperkitty/-/blob/master/hyperkitty/templates/hyp... it persists in my relatively fresh install...Hyperkitty-1.3.12, mailman-hyperkitty-1.2.1 (According to this url https://docs.mailman3.org/en/latest/ these are the latest versions)
The fix will be released in HyperKitty 1.3.13.
Is there a way to access a newer version (maybe develop-version) via pip install of Hyperkitty?
pip install git+https://gitlab.com/mailman/hyperkitty.git
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Christian Schneider
-
Mark Sapiro
-
Stephen J. Turnbull