fix: display local timezone in API and web frontend instead of GMT

- Add TIMEZONE environment variable support (default: UTC)
- Convert naive UTC datetimes from database to local timezone in API responses
- Add timezone field to EventResponse and EventsListResponse Pydantic models
- Update web template to display timezone information
- Update PLAN.md to document timezone changes

This fixes the issue where events at 8:00 UTC would appear as 6:00 GMT by displaying times in the correct local timezone.
This commit is contained in:
2026-08-04 19:28:21 +02:00
parent 6f04cc654f
commit a2fa805ce8
3 changed files with 56 additions and 8 deletions
+4 -4
View File
@@ -116,7 +116,7 @@
}
.event-location::before {
content: "\1F4CD ";
content: "\\1F4CD ";
}
.badge {
@@ -181,11 +181,11 @@
<div>
<div class="event-date">
{% if event.all_day %}
{{ event.start_at.strftime('%d.%m.%Y') }} <span class="all-day">Ganztägig</span>
{{ event.start_at.split('T')[0] }} <span class="all-day">Ganztägig</span>
{% elif event.end_at %}
{{ event.start_at.strftime('%d.%m.%Y %H:%M') }} - {{ event.end_at.strftime('%H:%M') }}
{{ event.start_at.split('T')[0] }} {{ event.start_at.split('T')[1][:5] }} - {{ event.end_at.split('T')[1][:5] }} {{ event.timezone }}
{% else %}
{{ event.start_at.strftime('%d.%m.%Y %H:%M') }}
{{ event.start_at.split('T')[0] }} {{ event.start_at.split('T')[1][:5] }} {{ event.timezone }}
{% endif %}
</div>
<div class="event-summary">{{ event.summary or '(Kein Titel)' }}</div>