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

Improve the date display of the German locale #2446

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</td>
<td>
<div class="block py-2 px-2 whitespace-nowrap text-gray-800">
{{ page_translation.last_updated|date:"d.m.Y, H:i" }}
{{ page_translation.last_updated }}
</div>
</td>
<td class="pl-2 pr-4 py-2 flex flex-nowrap justify-end gap-2">
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/templates/pages/page_tree_node.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
</td>
<td>
<div class="block py-1.5 px-2 whitespace-nowrap text-gray-800">
{{ page_translation.last_updated|date:"d.m.Y, H:i" }}
{{ page_translation.last_updated }}
</div>
</td>
<td class="pl-2 pr-4 py-1.5 text-right flex flex-nowrap gap-2">
Expand Down
5 changes: 5 additions & 0 deletions integreat_cms/core/formats/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
This package contains locale formats to override the default ones.
Create one file ``formats.py`` per locale directory.
See :setting:`django:FORMAT_MODULE_PATH` and :attr:`~integreat_cms.core.settings.FORMAT_MODULE_PATH` for more information.
"""
5 changes: 5 additions & 0 deletions integreat_cms/core/formats/de/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
This package contains locale formats to override the default ones.
Put all overrides into the file ``formats.py``.
See :setting:`django:FORMAT_MODULE_PATH` and :attr:`~integreat_cms.core.settings.FORMAT_MODULE_PATH` for more information.
"""
7 changes: 7 additions & 0 deletions integreat_cms/core/formats/de/formats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
This file contains locale formats to override the default ones.
See :setting:`django:FORMAT_MODULE_PATH` and :attr:`~integreat_cms.core.settings.FORMAT_MODULE_PATH` for more information.
"""

#: The default formatting to use for displaying datetime fields in any part of the system when using the German locale.
DATETIME_FORMAT = "d. F Y \\u\\m H:i \\U\\h\\r"
timobrembeck marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions integreat_cms/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,12 @@
#: (see :setting:`django:USE_TZ` and :doc:`django:topics/i18n/index`)
USE_TZ = True

#: A full Python path to a Python package that contains custom format definitions for project locales.
#: (see :setting:`django:FORMAT_MODULE_PATH`)
FORMAT_MODULE_PATH = [
"integreat_cms.core.formats",
]


##########################
# AUTOMATIC TRANSLATIONS #
Expand Down
2 changes: 2 additions & 0 deletions integreat_cms/release_notes/current/unreleased/2446.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
en: Improve the date display of the German locale
de: Verbessere die Datums-Anzeige der Deutschen Locale