Use relative time format for Last Updated

This commit is contained in:
世界
2025-12-06 22:27:42 +08:00
parent dcc6cd189c
commit bd5e5f3a79
5 changed files with 12 additions and 6 deletions
+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())
}
}