Fixes #2679 - Timestamps in room list inconsistently use absolute and relative formatting

This commit is contained in:
Stefan Ceriu
2024-06-18 17:38:52 +03:00
committed by Stefan Ceriu
parent 834260c144
commit 4a9de65030
4 changed files with 7 additions and 2 deletions
+3
View File
@@ -31,6 +31,9 @@ class DateTests: XCTestCase {
let yesterday = calendar.date(byAdding: .hour, value: 1, to: startOfYesterday)!
XCTAssertEqual(yesterday.formattedMinimal(), yesterday.formatted(Date.RelativeFormatStyle(presentation: .named, capitalizationContext: .beginningOfSentence)))
let nearYesterday = calendar.date(byAdding: DateComponents(hour: -10), to: today)!
XCTAssertEqual(nearYesterday.formattedMinimal(), yesterday.formatted(Date.RelativeFormatStyle(presentation: .named, capitalizationContext: .beginningOfSentence)))
let threeDaysAgo = calendar.date(byAdding: .day, value: -3, to: startOfToday)!
XCTAssertEqual(threeDaysAgo.formattedMinimal(), threeDaysAgo.formatted(.dateTime.weekday(.wide)))