Fixed a bug where conversations without messages could display invalid dates
This commit is contained in:
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…
Reference in New Issue