added view in timeline action, added tests

This commit is contained in:
Flavio Alescio
2023-01-27 15:07:32 +01:00
parent 0188075f57
commit 5ea70aacd8
15 changed files with 141 additions and 87 deletions
@@ -28,7 +28,7 @@ struct PollListItem: View {
var body: some View {
VStack(alignment: .leading, spacing: 12) {
Text(DateFormatter.shortDateFormatter.string(from: pollData.startDate))
Text(DateFormatter.pollShortDateFormatter.string(from: pollData.startDate))
.foregroundColor(theme.colors.tertiaryContent)
.font(theme.fonts.caption1)
@@ -68,8 +68,8 @@ struct PollListItem: View {
}
}
private extension DateFormatter {
static let shortDateFormatter: DateFormatter = {
extension DateFormatter {
static let pollShortDateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.timeStyle = .none
formatter.dateStyle = .short