mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 21:43:00 +00:00
Fix datetime comparison in MLBUpcomingManager by making both datetimes timezone-aware
This commit is contained in:
@@ -3,7 +3,7 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from typing import Dict, Any, List, Optional
|
from typing import Dict, Any, List, Optional
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta, timezone
|
||||||
import os
|
import os
|
||||||
from PIL import Image, ImageDraw, ImageFont
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@@ -552,7 +552,7 @@ class MLBUpcomingManager(BaseMLBManager):
|
|||||||
if games:
|
if games:
|
||||||
# Process games
|
# Process games
|
||||||
new_upcoming_games = []
|
new_upcoming_games = []
|
||||||
now = datetime.now()
|
now = datetime.now(timezone.utc) # Make timezone-aware
|
||||||
upcoming_cutoff = now + timedelta(hours=24)
|
upcoming_cutoff = now + timedelta(hours=24)
|
||||||
|
|
||||||
logger.info(f"Looking for games between {now} and {upcoming_cutoff}")
|
logger.info(f"Looking for games between {now} and {upcoming_cutoff}")
|
||||||
|
|||||||
Reference in New Issue
Block a user