Skip to content

Commit bc5ac00

Browse files
apps/projects: fix summary date formatting
1 parent dbcf1cf commit bc5ac00

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

apps/projects/views.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,20 @@ def _get_user_feedback(self, summary, request):
384384
return fb.feedback if fb else None
385385
return None
386386

387+
def _format_summary_date(self, timestamp, language_code):
388+
"""Format the summary date based on the current language."""
389+
if not timestamp:
390+
return None
391+
392+
local_ts = timezone.localtime(timestamp)
393+
394+
if language_code == "de":
395+
# German format: "1. April 2026"
396+
return local_ts.strftime("%-d. %B %Y")
397+
else:
398+
# English format: "April 1, 2026"
399+
return local_ts.strftime("%B %-d, %Y")
400+
387401
def get(self, request, *args, **kwargs):
388402
project = self.get_object()
389403
logger.info(

0 commit comments

Comments
 (0)