I have to update one index among 3 options how can I manipulate them depends on option that a user clicked on the UI
[{
future: false,
NumberOfDay: 0,
HourOption: ""
},
{
within_date: false,
start_date: "",
end_date: ""
},
{
indefinitely: false
}]
in case user select the first option future and numberOfDay would be changed and output might look like the following on index one of this array
[{
future: true,
NumberOfDay: Entered_Number_From_User,
HourOption: ""
},
{
within_date: false,
start_date: "",
end_date: ""
},
{
indefinitely: false
}]
in case user selects the second option on the UI
[{
future: false,
NumberOfDay: 0,
HourOption: ""
},
{
within_date: true,
start_date: `SELECTED_DATE_FROM_UI`,
end_date: `SELECTED_DATE_FROM_UI`
},
{
indefinitely: false
}]