This commit is contained in:
2024-04-11 08:47:41 +02:00
parent ca7a9c00f6
commit d856b83ec0

View File

@@ -163,7 +163,7 @@ class cls_caldav():
def convert_to_gmt1(self, dt):
gmt1_tz = pytz.timezone('Europe/Paris')
if dt.tzinfo is not None:
if hasattr(dt,"tzinfo") and dt.tzinfo is not None:
# Convertir l'objet datetime en GMT+1
# Utilisez le nom de votre fuseau horaire GMT+1
dt_gmt1 = dt.astimezone(gmt1_tz)
@@ -269,7 +269,7 @@ class cls_caldav_client():
def init_caldav(self, caldav_url, caldav_user, caldav_password):
client = caldav.DAVClient(url=caldav_url, username=caldav_user, password=caldav_password)
self.data = self.client.principal()
self.data = client.principal()
for cal in self.data.calendars():
print(f"name: {cal.name}({cal.url})")