EDT: lien saisie abs avec heure slocales serveur

This commit is contained in:
Emmanuel Viennet 2023-11-13 23:43:54 +01:00
parent 456d570c9b
commit 324488f9c4
1 changed files with 10 additions and 2 deletions

View File

@ -30,6 +30,7 @@
XXX usage uniquement experimental pour tests implémentations
"""
from datetime import timezone
import re
import icalendar
@ -249,8 +250,15 @@ def _load_and_convert_ics(formsemestre: FormSemestre) -> list[dict]:
"group_bg_color": group_bg_color, # associée au groupe
"modimpl": modimpl, # False si extracteur non configuré
"edt_module": edt_module, # id module edt non traduit
"heure_deb": event.decoded("dtstart").strftime("%H:%M"),
"heure_fin": event.decoded("dtend").strftime("%H:%M"),
# heures pour saisie abs: en heure LOCALE DU SERVEUR
"heure_deb": event.decoded("dtstart")
.replace(tzinfo=timezone.utc)
.astimezone(tz=None)
.strftime("%H:%M"),
"heure_fin": event.decoded("dtend")
.replace(tzinfo=timezone.utc)
.astimezone(tz=None)
.strftime("%H:%M"),
"jour": event.decoded("dtstart").isoformat(),
"start": event.decoded("dtstart").isoformat(),
"end": event.decoded("dtend").isoformat(),