Skip to content

Commit

Permalink
Merge pull request #2446 from digitalfabrik/feature/date-formats
Browse files Browse the repository at this point in the history
Improve the date display of the German locale
  • Loading branch information
timobrembeck committed Oct 10, 2023
2 parents fc4428d + 07d4076 commit 349330e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 2 deletions.
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"
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

0 comments on commit 349330e

Please sign in to comment.