sort completed workouts by date

This commit is contained in:
Trey t
2024-11-25 09:14:01 -08:00
parent abb9feed14
commit 63b7a2daa5
2 changed files with 2 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ struct WorkoutHistoryView: View {
var body: some View {
List {
ForEach(completedWorkouts, id:\.self.id) { completedWorkout in
ForEach(completedWorkouts.sorted(by: { $0.createdAt > $1.createdAt }), id:\.self.id) { completedWorkout in
HStack {
VStack {
if let date = completedWorkout.workoutStartTime.dateFromServerDate {