From f242fee5ff7fd676f7f510e1fb9f62fd356b1c19 Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 27 Feb 2024 23:14:12 +0100 Subject: [PATCH] =?UTF-8?q?Assiduit=C3=A9=20:=20calendrier=20fix=20str=5Ft?= =?UTF-8?q?o=5Ftime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/assiduites.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/assiduites.py b/app/views/assiduites.py index b358276f0..a3f5379d8 100644 --- a/app/views/assiduites.py +++ b/app/views/assiduites.py @@ -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