mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Use a Date for the timestamp in all timeline items. (#3590)
* Use a Date for the timestamp in all timeline items. * UI test snapshots. * Update snapshots --------- Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
@@ -32,4 +32,14 @@ extension Date {
|
||||
return formatted(.dateTime.year().day().month())
|
||||
}
|
||||
}
|
||||
|
||||
/// The date formatted as just the time, for use in timeline items specifically.
|
||||
func formattedTime() -> String {
|
||||
formatted(date: .omitted, time: .shortened)
|
||||
}
|
||||
|
||||
/// A fixed date used for mocks, previews etc.
|
||||
static var mock: Date {
|
||||
Calendar.current.startOfDay(for: .now).addingTimeInterval((9 * 60 * 60) + (41 * 60)) // 9:41 am
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user