Skip to content

Commit

Permalink
Fixed datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko259 committed Jan 26, 2025
1 parent 9bc5d5a commit 2f2e398
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers/staffing_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ async def _geteventdate(self, title, interval = 1):
print(f"Start time not found for event '{title}'.")
return None, None, None, None

start_time = datetime.strptime(start_time, "%Y-%m-%dT%H:%M:%S") # Convert to datetime
start_time = datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S") # Convert to datetime
formatted_start_time = start_time.strftime("%H:%M")

# Handle missing end time (default: 2 hours after start)
if end_time:
end_time = datetime.strptime(end_time, "%Y-%m-%dT%H:%M:%S").strftime("%H:%M")
end_time = datetime.strptime(end_time, "%Y-%m-%d %H:%M:%S").strftime("%H:%M")
else:
end_time = (start_time + timedelta(hours=2)).strftime("%H:%M")

Expand Down

0 comments on commit 2f2e398

Please sign in to comment.