Cleaned up and removed columns so it is what an actual Solari board would show

- This update adds ISO date/time helpers for Amtrak timestamps, refactors the train table to show arrival time, status, and track details, and tracks the current station context in the UI.
- It also hardens station status decoding with a safe fallback to Unknown and simplifies the row model to match the new display.
This commit is contained in:
Tony Bark 2026-08-23 19:52:27 -04:00
parent ebff2c9c32
commit bf67475107
3 changed files with 99 additions and 31 deletions

View file

@ -0,0 +1,37 @@
import Foundation
struct AmtrakDateFormatting {
static let isoFormatter = ISO8601DateFormatter()
static let timeFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateStyle = .none
formatter.timeStyle = .short
return formatter
}()
static let dateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateStyle = .medium
formatter.timeStyle = .none
return formatter
}()
static func time(from isoString: String?) -> String? {
guard let isoString, !isoString.isEmpty, let date = isoFormatter.date(
from: isoString) else {
return nil
}
return timeFormatter.string(from: date)
}
static func date(from isoString: String?) -> String? {
guard let isoString, !isoString.isEmpty, let date = isoFormatter.date(
from: isoString) else {
return nil
}
return dateFormatter.string(from: date)
}
}