Fixed a bug where conversations without messages could display invalid dates

This commit is contained in:
Morgan Pretty 2023-08-11 18:58:04 +10:00
parent ef5aa927a0
commit 382b466ded
1 changed files with 3 additions and 0 deletions

View File

@ -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 {