The screen shows a brief report summary: a title, a human-readable date range, and a subtitle with the number of days. After a recent change, the behavior became inconsistent: when the input data is updated, part of the text remains from the previous state, and for some locales the date format stopped matching the passed configuration.
ReportSummaryView must display data from the passed report without needing to recreate the screen.localeIdentifier from the Report model.endDate, only the start date should be shown.dayCountText subtitle must match the current date range and the current locale.ReportSummaryView instance must be reflected in summaryText and dayCountText.ReportSummaryView with the first report, then update the same screen with a new report value.en_US, then replace it with a report with locale fr_FR.localeIdentifier.endDate == nil.To reproduce, it is enough to use this data flow:
let first = Report(
title: "Weekly sales",
startDate: Date(timeIntervalSince1970: 1_717_200_000),
endDate: Date(timeIntervalSince1970: 1_717_286_400),
localeIdentifier: "en_US"
)
let second = Report(
title: "Ventes hebdomadaires",
startDate: Date(timeIntervalSince1970: 1_717_459_200),
endDate: nil,
localeIdentifier: "fr_FR"
)
report, the screen should recalculate both lines based on the new report.fr_FR, dates should be formatted in the French locale, not the current system locale.endDate == nil, the final string must not contain the old end date from the previous report.Swift 6ReportSummaryViewModel and ReportSummaryView types are isolated to @MainActorDateFormatter without network or system side effectsCalendar(identifier: .gregorian)TimeZone(secondsFromGMT: 0)Use line comments to explain the problem, its impact, the fix and how to test it.