mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
MESSENGER-4798 change date format for poll details
This commit is contained in:
@@ -49,8 +49,15 @@ struct PollParticipantVoter: Identifiable, BindableState {
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.timeZone = TimeZone.current
|
||||
dateFormatter.calendar = Calendar.current
|
||||
dateFormatter.dateFormat = "dd. MMMM, yyyy HH:mm"
|
||||
let strDate = dateFormatter.string(from: votingTime)
|
||||
var strDate = ""
|
||||
if Calendar.current.isDateInToday(votingTime) {
|
||||
dateFormatter.dateFormat = "HH:mm"
|
||||
strDate = "Heute, ".appending(dateFormatter.string(from: votingTime))
|
||||
} else {
|
||||
dateFormatter.dateFormat = "E, d. MMM yyyy, HH:mm"
|
||||
strDate = dateFormatter.string(from: votingTime)
|
||||
}
|
||||
strDate.append(contentsOf: " Uhr")
|
||||
|
||||
return PollParticipantVoter(displayName: user.displayname, userAvatarData: avatarData, formattedVotingTime: strDate)
|
||||
} else {
|
||||
|
||||
@@ -86,6 +86,7 @@ struct PollParticipantVoterView: View {
|
||||
.font(theme.fonts.footnote)
|
||||
.foregroundColor(theme.colors.secondaryContent)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user