roggervalf / react-appointment-picker

React component to pick an appointment
MIT License
10 stars 13 forks source link

One exclusive appointment #3

Closed irvingsl closed 4 years ago

irvingsl commented 5 years ago

Could be an option, like if we set the maxReservableAppointments to 0, that only one appoitment is acceptable, when we click on another apointment, it automaticallys remove the first one. I was trying to made that change, but I'm still too newbie in JS.

Thanks!

roggervalf commented 5 years ago

Hi irvingsl, maxReservableAppointments represents how many appointments can be selected. I put the deselection like mandatory because I thought that people will run a query for deselect that especific periods of time, so someone else could select an appointment in that periods, also people can select more appointment if they need. The way of selecting and remove the first one should have two transactions in the same function (one for delete the periods selected and one for create the selections in the new appointment periods). I base this way in some movie theaters apps from my country. I hope you could use this package, if you have some other doubt, I would answer you as soon as possible.

roggervalf commented 4 years ago

Hi @irvingsl, I already add a new feature that can help you. I hope you can check it.