From 4b59c6e1566344b25d61e4db7c4b14a4fbfe51e2 Mon Sep 17 00:00:00 2001 From: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com> Date: Thu, 3 Sep 2026 12:03:59 +0200 Subject: [PATCH] Use UTC+2 datetime in calendar notifications --- app/modules/calendar/endpoints_calendar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/modules/calendar/endpoints_calendar.py b/app/modules/calendar/endpoints_calendar.py index 2250073219..0e4db7a6cd 100644 --- a/app/modules/calendar/endpoints_calendar.py +++ b/app/modules/calendar/endpoints_calendar.py @@ -1,5 +1,6 @@ import uuid from datetime import UTC, datetime +from zoneinfo import ZoneInfo from fastapi import Depends, HTTPException from fastapi.responses import FileResponse @@ -379,7 +380,7 @@ async def add_event( ) if event.notification: ticket_date = ( - f", SG le {ticket_url_opening.strftime('%d/%m/%Y à %H:%M')}" + f", SG le {ticket_url_opening.astimezone(ZoneInfo('Europe/Paris')).strftime('%d/%m/%Y à %H:%M')}" if ticket_url_opening else "" ) @@ -591,7 +592,7 @@ async def confirm_event( if association is None: raise HTTPException(status_code=404, detail="Association not found") ticket_date = ( - f", SG le {event.ticket_url_opening.strftime('%d/%m/%Y à %H:%M')}" + f", SG le {event.ticket_url_opening.astimezone(ZoneInfo('Europe/Paris')).strftime('%d/%m/%Y à %H:%M')}" if event.ticket_url_opening else "" )