You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
//
|
|
// WeekdayselectionView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 24/09/2025.
|
|
//
|
|
|
|
import SwiftUI
|
|
import PadelClubData
|
|
import LeStorage
|
|
|
|
struct WeekdayselectionView: View {
|
|
@Binding var weekdays: Set<Int>
|
|
|
|
var body: some View {
|
|
NavigationLink {
|
|
List((1...7), selection: $weekdays) { type in
|
|
Text(Date.weekdays[type - 1]).tag(type as Int)
|
|
}
|
|
.navigationTitle("Jour de la semaine")
|
|
.environment(\.editMode, Binding.constant(EditMode.active))
|
|
} label: {
|
|
HStack {
|
|
Text("Jour de la semaine")
|
|
Spacer()
|
|
if weekdays.isEmpty || weekdays.count == 7 {
|
|
Text("N'importe")
|
|
.foregroundStyle(.secondary)
|
|
} else {
|
|
Text(weekdays.sorted().map({ Date.weekdays[$0 - 1] }).joined(separator: ", "))
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|