Fixed a bug where conversations without messages could display invalid dates

pull/886/head
Morgan Pretty 2 years ago
parent ef5aa927a0
commit 382b466ded

@ -5,6 +5,9 @@ import SessionUtilitiesKit
public extension Date {
var formattedForDisplay: String {
// If we don't have a date then
guard self.timeIntervalSince1970 > 0 else { return "" }
let dateNow: Date = Date()
guard Calendar.current.isDate(self, equalTo: dateNow, toGranularity: .year) else {

Loading…
Cancel
Save