mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
Fix game time and date extraction in NHL managers - Initialize game_time and game_date variables - Format time and date from UTC to local time
This commit is contained in:
@@ -142,6 +142,15 @@ class BaseNHLManager:
|
|||||||
home_team = next(c for c in competitors if c.get("homeAway") == "home")
|
home_team = next(c for c in competitors if c.get("homeAway") == "home")
|
||||||
away_team = next(c for c in competitors if c.get("homeAway") == "away")
|
away_team = next(c for c in competitors if c.get("homeAway") == "away")
|
||||||
|
|
||||||
|
# Format game time and date for display
|
||||||
|
game_time = ""
|
||||||
|
game_date = ""
|
||||||
|
if start_time_utc:
|
||||||
|
# Convert to local time
|
||||||
|
local_time = start_time_utc.astimezone()
|
||||||
|
game_time = local_time.strftime("%I:%M %p")
|
||||||
|
game_date = local_time.strftime("%b %d")
|
||||||
|
|
||||||
details = {
|
details = {
|
||||||
"start_time_utc": start_time_utc,
|
"start_time_utc": start_time_utc,
|
||||||
"status_text": status["type"]["shortDetail"],
|
"status_text": status["type"]["shortDetail"],
|
||||||
|
|||||||
Reference in New Issue
Block a user