Use relative time format for Last Updated
This commit is contained in:
5 files changed
+12
-6
No files matched your search
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user