mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fixes #2679 - Timestamps in room list inconsistently use absolute and relative formatting
This commit is contained in:
committed by
Stefan Ceriu
parent
834260c144
commit
4a9de65030
@@ -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)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user