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 @@
{% for group in object.messages_by_month %}
+ data-key="{{ group.start_date|date:'Y-m' }}"> -
{{ group.date|date:'F Y' }}
+
{{ group.start_date|date:'F Y' }}
{% spaceless %} {% blocktrans count counter=group.messages|length %} - One Message - {% plural %} - {{ counter }} Messages - {% endblocktrans %} + One Message + {% plural %} + {{ counter }} Messages + {% endblocktrans %} {% if not group.show_overdue_message and group.indicate_overdue %} - ({% trans 'overdue' %}) + ({% trans "overdue" %}) {% endif %} {% endspaceless %}
@@ -35,7 +35,7 @@
- {% trans 'Scroll to end' %} + {% trans "Scroll to end" %} {% endwith %} {% endwith %}