File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ def check_slot_available(self, slot):
159159 available_now = False
160160 when = []
161161 else :
162- start = datetime .fromisoformat (avail [0 ]["start" ])
163- end = datetime .fromisoformat (avail [0 ]["end" ])
162+ start = datetime .strptime (avail [0 ]["start" ], "%Y-%m-%dT%H:%M:%S.%fZ" ). replace ( tzinfo = timezone . utc )
163+ end = datetime .strptime (avail [0 ]["end" ], "%Y-%m-%dT%H:%M:%S.%fZ" ). replace ( tzinfo = timezone . utc )
164164 when = {"start" : start , "end" : end }
165165 available_now = when ["start" ] <= (datetime .now (timezone .utc ) +
166166 timedelta (seconds = 1 ))
@@ -296,8 +296,8 @@ def get_bookings(self):
296296 self .bookings = []
297297
298298 for booking in bookings :
299- start = datetime .fromisoformat (booking ["when" ]["start" ])
300- end = datetime .fromisoformat (booking ["when" ]["end" ])
299+ start = datetime .strptime (booking ["when" ]["start" ], "%Y-%m-%dT%H:%M:%S.%fZ" ). replace ( tzinfo = timezone . utc )
300+ end = datetime .strptime (booking ["when" ]["end" ], "%Y-%m-%dT%H:%M:%S.%fZ" ). replace ( tzinfo = timezone . utc )
301301
302302 if now >= start and now <= end :
303303 self .bookings .append (booking )
You can’t perform that action at this time.
0 commit comments