I have the following DatePicker:
Section(header: Text(\"Notifications will be triggered only between \\(startDay) and \\(endDay)\")) {
DatePi
Use DateFormatter, for example something like:
var dateFormatter: DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = "HH:mm"
return formatter
}
Section(header: Text("Notifications will be triggered only between \(dateFormatter.string(from: startDay)) and \(dateFormatter.string(from: endDay))")) {
DatePicker("Start day", selection: $startDay, displayedComponents: .hourAndMinute)
DatePicker("End day", selection: $endDay, displayedComponents: .hourAndMinute)
}