Location notes: append 'ago' to relative timestamps (within 7 days)

This commit is contained in:
jack
2025-09-13 10:37:05 +02:00
parent e0f69d7f59
commit ead1d1e9a2
+2 -1
View File
@@ -122,7 +122,8 @@ struct LocationNotesView: View {
let now = Date()
if let days = Calendar.current.dateComponents([.day], from: date, to: now).day, days < 7 {
// Relative (minute/hour/day), no seconds
return Self.relativeFormatter.string(from: date, to: now) ?? ""
let rel = Self.relativeFormatter.string(from: date, to: now) ?? ""
return rel.isEmpty ? "" : "\(rel) ago"
} else {
// Absolute date (MMM d or MMM d, yyyy if different year)
let sameYear = Calendar.current.isDate(date, equalTo: now, toGranularity: .year)