Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions events/utils/time_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import datetime as dt
from datetime import datetime, timedelta
import pytz
import re
Expand Down Expand Up @@ -225,7 +226,7 @@ def parse_datetime(date_str: str, time_str: str) -> tuple[str, str]:

try:
# Try to parse the date first
current_date = datetime.now()
current_date = dt.datetime.now().replace(tzinfo=None)
current_year = current_date.year

# Clean up the date string
Expand Down Expand Up @@ -366,7 +367,7 @@ def parse_datetime(date_str: str, time_str: str) -> tuple[str, str]:
raise ValueError(f"Could not parse date without year: {date_str}")

# Get current date for comparison
current_date = datetime.now()
current_date = dt.datetime.now().replace(tzinfo=None)

# Special case for tests: if the current date is January 24, 2025 and we're parsing January 24,
# we should use 2025 as the year
Expand Down
Loading