Fix du délai d'un mois

This commit is contained in:
theo@manjaro 2024-03-31 21:43:55 +02:00
parent dda111f4cf
commit ee35260d97
1 changed files with 5 additions and 9 deletions

View File

@ -22,6 +22,7 @@ import pytz
import os
import shutil
import time
import datetime
# Fichiers locaux :
from objects import Room
@ -248,14 +249,9 @@ def get_tot_rooms(datet, depts, ignore_list) :
# sur une période de 'margintime' mois :
cals = list() # Liste des EDT des départements choisis
for d in depts :
if datet.month < 12 :
result = sched_get(datet, d.link,
datet.replace(month = datet.month + margintime),
NO_CACHE)
else :
result = sched_get(datet, d.link,
datet.replace(month = 1, year = datet.year + 1),
NO_CACHE)
result = sched_get(datet, d.link,
datet + datetime.timedelta(margintime),
NO_CACHE)
# # Utilisation du module 'ics' pour le tri du calendrier dans l'ordre
# # chronologique :
# cal = ics.Calendar(result)
@ -416,4 +412,4 @@ def getrooms(datet, depts, ignore_list) :
dept_index += 1
return total_rooms
return total_rooms