diff --git a/froide/foirequest/models/request.py b/froide/foirequest/models/request.py index d0d0903c4..6b5122adb 100644 --- a/froide/foirequest/models/request.py +++ b/froide/foirequest/models/request.py @@ -497,10 +497,11 @@ def messages_by_month(self): due_date = self.due_date has_overdue_messages = False for msg in self.messages: - key = str(msg.timestamp)[:7] + local_msg_timestamp = timezone.localtime(msg.timestamp) + key = local_msg_timestamp.strftime("%Y-%m") if key not in groups: groups[key] = { - "date": msg.timestamp.replace( + "date": local_msg_timestamp.replace( day=1, hour=0, minute=0, second=0, microsecond=0 ), "messages": [], diff --git a/froide/foirequest/templates/foirequest/body/timeline.html b/froide/foirequest/templates/foirequest/body/timeline.html index 49ed8cc2f..df8bf39f9 100644 --- a/froide/foirequest/templates/foirequest/body/timeline.html +++ b/froide/foirequest/templates/foirequest/body/timeline.html @@ -5,19 +5,19 @@