Use relative time format for Last Updated

This commit is contained in:
世界 committed 2025-12-06 22:27:42 +08:00
1 parent dcc6cd189c
commit bd5e5f3a79
5 files changed
+12 -6

No files matched your search

+6
View File
@@ -6,4 +6,10 @@ public extension Date {
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
return dateFormatter.string(from: self)
}
var relativeFormat: String {
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .full
return formatter.localizedString(for: self, relativeTo: Date())
}
}