Assiduité : calendrier fix str_to_time

This commit is contained in:
Iziram 2024-02-27 23:14:12 +01:00
parent c960d943d2
commit f242fee5ff

View File

@ -2361,6 +2361,9 @@ class Jour:
heure_matin = scass.str_to_time(
ScoDocSiteConfig.get("assi_morning_time", "08:00")
)
log(
f'{ScoDocSiteConfig.get("assi_morning_time", "08:00")=}{heure_matin=} {type(heure_matin)=}'
)
matin = (
# date debut
scu.localize_datetime(
@ -2447,15 +2450,11 @@ class Jour:
Génère la minitimeline du jour
"""
# Récupérer le référenciel de la timeline
scass.str_to_time = lambda x: _time_to_timedelta(
datetime.time(*list(map(int, x.split(":"))))
heure_matin: datetime.timedelta = _time_to_timedelta(
scass.str_to_time(ScoDocSiteConfig.get("assi_morning_time", "08:00"))
)
heure_matin: datetime.timedelta = scass.str_to_time(
ScoDocSiteConfig.get("assi_morning_time", "08:00")
)
heure_soir: datetime.timedelta = scass.str_to_time(
ScoDocSiteConfig.get("assi_afternoon_time", "17:00")
heure_soir: datetime.timedelta = _time_to_timedelta(
scass.str_to_time(ScoDocSiteConfig.get("assi_afternoon_time", "17:00"))
)
# longueur_timeline = heure_soir - heure_matin
longueur_timeline: datetime.timedelta = heure_soir - heure_matin