|
|
@@ -74,7 +74,6 @@ extension AddCarbs {
|
|
|
|
|
|
// Time
|
|
|
HStack {
|
|
|
- let now = Date.now
|
|
|
Text("Time")
|
|
|
Spacer()
|
|
|
if !pushed {
|
|
|
@@ -87,14 +86,11 @@ extension AddCarbs {
|
|
|
DatePicker(
|
|
|
"Time",
|
|
|
selection: $state.date,
|
|
|
- in: ...now,
|
|
|
displayedComponents: [.hourAndMinute]
|
|
|
).controlSize(.mini)
|
|
|
.labelsHidden()
|
|
|
Button {
|
|
|
- if state.date.addingTimeInterval(5.minutes.timeInterval) < now {
|
|
|
- state.date = state.date.addingTimeInterval(10.minutes.timeInterval)
|
|
|
- }
|
|
|
+ state.date = state.date.addingTimeInterval(10.minutes.timeInterval)
|
|
|
}
|
|
|
label: { Image(systemName: "plus.circle") }.tint(.blue).buttonStyle(.borderless)
|
|
|
}
|