fix(display): use stadium timezone for all game time displays

Game times were incorrectly using device timezone in several views.
Now all game time displays use the stadium's local timezone via
RichGame.localGameTime/localGameTimeShort properties.

Fixes:
- PDFGenerator: was using game.gameDate (midnight UTC) instead of actual time
- GameRowCompact: was formatting with device timezone
- TimelineGameRow: was using .formatted() with device timezone

Also adds Date+GameTime.swift extension for centralized timezone formatting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-20 22:44:40 -06:00
parent 74fd21590b
commit 166ad5d6f9
4 changed files with 75 additions and 9 deletions

View File

@@ -562,10 +562,8 @@ final class PDFGenerator {
]
(teamsText as NSString).draw(at: CGPoint(x: margin + 14, y: currentY), withAttributes: teamsAttributes)
// Time: "7:00 PM"
let timeFormatter = DateFormatter()
timeFormatter.dateFormat = "h:mm a" // "7:00 PM"
let timeText = timeFormatter.string(from: richGame.game.gameDate)
// Time: "7:00 PM EDT" (stadium local time with timezone indicator)
let timeText = richGame.localGameTime
let timeAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 13),
.foregroundColor: textSecondary