|
|
|
|
@ -19,7 +19,7 @@ struct PlanningView: View { |
|
|
|
|
@State private var showFinishedMatches: Bool = false |
|
|
|
|
@State private var enableMove: Bool = false |
|
|
|
|
@Environment(\.editMode) private var editMode |
|
|
|
|
|
|
|
|
|
let updatePlannedDatesTip = UpdatePlannedDatesTip() |
|
|
|
|
let allMatches: [Match] |
|
|
|
|
let timeSlotMoveOptionTip = TimeSlotMoveOptionTip() |
|
|
|
|
|
|
|
|
|
@ -189,6 +189,23 @@ struct PlanningView: View { |
|
|
|
|
filterOption == .byCourt || showFinishedMatches ? .fill : .none) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Button("Mettre à jour", systemImage: "arrow.trianglehead.2.clockwise.rotate.90.circle") { |
|
|
|
|
let now = Date() |
|
|
|
|
matches.forEach { |
|
|
|
|
if let startDate = $0.startDate, startDate > now { |
|
|
|
|
$0.plannedStartDate = $0.startDate |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let groupByTournaments = matches.grouped { match in |
|
|
|
|
match.currentTournament() |
|
|
|
|
} |
|
|
|
|
groupByTournaments.forEach { tournament, matches in |
|
|
|
|
tournament?.tournamentStore?.matches.addOrUpdate(contentOfs: matches) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.popoverTip(updatePlannedDatesTip) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|