mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
game time formatting to remove space between time and AM/PM
This commit is contained in:
@@ -298,7 +298,7 @@ class BaseMiLBManager:
|
||||
dt = dt.replace(tzinfo=pytz.UTC)
|
||||
local_dt = dt.astimezone(tz)
|
||||
|
||||
return local_dt.strftime("%I:%M %p").lstrip('0')
|
||||
return local_dt.strftime("%I:%M%p").lstrip('0')
|
||||
except Exception as e:
|
||||
logger.error(f"Error formatting game time: {e}")
|
||||
return "TBD"
|
||||
|
||||
@@ -372,7 +372,7 @@ class BaseMLBManager:
|
||||
dt = dt.replace(tzinfo=pytz.UTC)
|
||||
local_dt = dt.astimezone(tz)
|
||||
|
||||
return local_dt.strftime("%I:%M %p").lstrip('0')
|
||||
return local_dt.strftime("%I:%M%p").lstrip('0')
|
||||
except Exception as e:
|
||||
logger.error(f"Error formatting game time: {e}")
|
||||
return "TBD"
|
||||
|
||||
@@ -442,7 +442,7 @@ class BaseNBAManager:
|
||||
if start_time_utc:
|
||||
# Convert to local time
|
||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
||||
game_time = local_time.strftime("%I:%M %p").lstrip('0')
|
||||
game_time = local_time.strftime("%I:%M%p").lstrip('0')
|
||||
game_date = local_time.strftime("%-m/%-d")
|
||||
|
||||
# Calculate if game is within recent window
|
||||
|
||||
@@ -361,7 +361,7 @@ class BaseNCAABaseballManager:
|
||||
if dt.tzinfo is None:
|
||||
dt = dt.replace(tzinfo=pytz.UTC)
|
||||
local_dt = dt.astimezone(tz)
|
||||
return local_dt.strftime("%I:%M %p").lstrip('0')
|
||||
return local_dt.strftime("%I:%M%p").lstrip('0')
|
||||
except Exception as e:
|
||||
logger.error(f"[NCAABaseball] Error formatting game time: {e}")
|
||||
return "TBD"
|
||||
|
||||
@@ -483,7 +483,7 @@ class BaseNCAAFBManager: # Renamed class
|
||||
game_time, game_date = "", ""
|
||||
if start_time_utc:
|
||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
||||
game_time = local_time.strftime("%I:%M %p").lstrip('0')
|
||||
game_time = local_time.strftime("%I:%M%p").lstrip('0')
|
||||
game_date = local_time.strftime("%-m/%-d")
|
||||
|
||||
# --- Football Specific Details (Likely same for NFL/NCAAFB) ---
|
||||
|
||||
@@ -449,7 +449,7 @@ class BaseNCAAMBasketballManager:
|
||||
if start_time_utc:
|
||||
# Convert to local time
|
||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
||||
game_time = local_time.strftime("%I:%M %p").lstrip('0')
|
||||
game_time = local_time.strftime("%I:%M%p").lstrip('0')
|
||||
game_date = local_time.strftime("%-m/%-d")
|
||||
|
||||
# Calculate if game is within recent window
|
||||
|
||||
@@ -408,10 +408,11 @@ class BaseNFLManager: # Renamed class
|
||||
# Remove early filtering - let individual managers handle their own filtering
|
||||
# This allows shared data to contain all games, and each manager can filter as needed
|
||||
|
||||
game_time, game_date = "", ""
|
||||
game_time = ""
|
||||
game_date = ""
|
||||
if start_time_utc:
|
||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
||||
game_time = local_time.strftime("%I:%M %p").lstrip('0')
|
||||
game_time = local_time.strftime("%I:%M%p").lstrip('0')
|
||||
game_date = local_time.strftime("%-m/%-d")
|
||||
|
||||
# --- NFL Specific Details ---
|
||||
|
||||
@@ -392,7 +392,7 @@ class BaseNHLManager:
|
||||
if start_time_utc:
|
||||
# Convert to local time
|
||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
||||
game_time = local_time.strftime("%-I:%M %p")
|
||||
game_time = local_time.strftime("%-I:%M%p")
|
||||
game_date = local_time.strftime("%-m/%-d")
|
||||
|
||||
# Calculate if game is within recent window
|
||||
|
||||
@@ -321,7 +321,7 @@ class OddsTickerManager:
|
||||
if game_time.tzinfo is None:
|
||||
game_time = game_time.replace(tzinfo=pytz.UTC)
|
||||
local_time = game_time.astimezone(tz)
|
||||
time_str = local_time.strftime("%I:%M %p").lstrip('0')
|
||||
time_str = local_time.strftime("%I:%M%p").lstrip('0')
|
||||
|
||||
return f"[{time_str}] {game['away_team']} vs {game['home_team']} (No odds)"
|
||||
|
||||
@@ -426,7 +426,7 @@ class OddsTickerManager:
|
||||
# Capitalize full day name, e.g., 'Tuesday'
|
||||
day_text = local_time.strftime("%A")
|
||||
date_text = local_time.strftime("%-m/%d")
|
||||
time_text = local_time.strftime("%I:%M %p").lstrip('0')
|
||||
time_text = local_time.strftime("%I:%M%p").lstrip('0')
|
||||
|
||||
# Team and record text
|
||||
away_team_text = f"{game.get('away_team', 'N/A')} ({game.get('away_record', '') or 'N/A'})"
|
||||
|
||||
Reference in New Issue
Block a user