commit 2e86faee8413b57e5198319496dc07191021fa06 from: mtmn date: Fri Jul 10 17:07:07 2026 UTC fix: use local timezone commit - 28f4feeb85ad209945509a7ef793a5b38c78db63 commit + 2e86faee8413b57e5198319496dc07191021fa06 blob - 5108e2b76716a655a1dddcb1c3933c17f2419f42 blob + 45c5c6d65d2026d16b5c7751132ede23400bad67 --- src/display.rs +++ src/display.rs @@ -1,5 +1,5 @@ use crate::models::{Match, StandingsResponse}; -use chrono::Utc; +use chrono::Local; use prettytable::{Cell, Row, Table, format}; const STATUS_ICONS: &[(&str, &str)] = &[("FINISHED", "✓"), ("SCHEDULED", "⏰"), ("IN_PLAY", "▶")]; @@ -11,11 +11,12 @@ pub fn filter_matches( team_filter: Option<&str>, show_all: bool, ) -> Vec { - let today_start = Utc::now() + let today_start = Local::now() .date_naive() .and_hms_opt(0, 0, 0) .unwrap() - .and_utc(); + .and_local_timezone(Local) + .unwrap(); matches .into_iter() @@ -90,7 +91,11 @@ pub fn display_table(matches: &[Match], show_competiti let date = m.utc_date.map_or_else( || "TBD".to_string(), - |dt| dt.format("%b %d, %Y %H:%M UTC").to_string(), + |dt| { + dt.with_timezone(&Local) + .format("%b %d, %Y %H:%M %:z") + .to_string() + }, ); let score = match (m.score.full_time.home, m.score.full_time.away) { @@ -181,7 +186,7 @@ pub fn display_standings(standings_response: Standings mod tests { use super::*; use crate::models::{Score, ScoreDetail, Team}; - use chrono::TimeZone; + use chrono::{TimeZone, Utc}; fn create_match(date: Option>, home: &str, away: &str) -> Match { Match {