I want only to get Int day from a date.
ScrollView(.horizontal) {
HStack(spacing: 60) {
ForEach(steps, id: \.id) { day in
Text(day.date, style: .date)
.onTapGesture {
selectedDay = day
}
}
}
}
With this code, I get the date as November 5, 2020, but I only need 5 from all date.
struct Step: Identifiable {
let id = UUID()
let count: Int
let date: Date
let wc: Double
}