From 9a87edc280b9e8142acb87bcc8ccde87c6ceb75b Mon Sep 17 00:00:00 2001 From: Sylvia McLaughlin <85905333+sylviamclaughlin@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:19:12 -0700 Subject: [PATCH] Fixing up calendar scheduling (#480) --- app/modules/incident/schedule_retro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/modules/incident/schedule_retro.py b/app/modules/incident/schedule_retro.py index 16c120ff..b068f3f7 100644 --- a/app/modules/incident/schedule_retro.py +++ b/app/modules/incident/schedule_retro.py @@ -1,5 +1,5 @@ import logging -from datetime import datetime, timedelta, timezone +from datetime import datetime, timedelta import json @@ -13,10 +13,10 @@ # Schedule a calendar event by finding the first available slot in the next 60 days that all participants are free in and book the event def schedule_event(event_details, days): # Define the time range for the query - now = datetime.now(timezone.utc) + now = datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0) # time_min is the current time + days and time_max is the current time + 60 days + days - time_min = (now + timedelta(days=days)).isoformat() - time_max = (now + timedelta(days=(60 + days))).isoformat() + time_min = (now + timedelta(days=days)).isoformat() + "Z" + time_max = (now + timedelta(days=(60 + days))).isoformat() + "Z" # Construct the items array items = []