Hi ,
I'm making a room booking platform and have encountered an issue during input validation, My current validations stop the user from booking a room at an already booked time , but the user is able to book a room in between the start and end time of a booking.
For example : user A books a room from 12 to 1.
User B tries to book the room at 12 or 1 = the application stops the user from doing so
but
User B is able book the room in between 12:01 to 12:59 = this shouldn't happen , I haven't been able to work out a solution to this problem
Any help would be appreciated .
Hope i'm clear to you, Thanks
Hi Noor,
What should happen if your booking time is from 11 to 12? It will allow user or not then?
And one more, What inputs user have to book time for a room?
Please confirm so that, it would be helpful for us to give you solution.
Thanks
It will allow the user to book the room if no one else has booked the room at 11 or 12.
I have attached a photo of the required inputs from users
You can try using following validation rule if you have two inputs for BookingStartTime and BookingEndTime
If((BookingStartTime >= Entity.StartTime and BookingStartTime <=Entity.EndTime) and (BookingEndTime >= Entity.StartTime and BookingEndTime <= Entity.EndTime))
True{
//Show Validations
}
False{
//Allow Booking
Hope this helps, Thanks :)
I tried your expression and its giving me the same problem , basically the Entity.StartTime is showing up as 00:00:00 when i try to compare to BookingStartTime .
My current validations
Entity.StartTime is the time stored in your Database. You have to compare your inputted time with time stored in DB.
It would be great if you can share OML here to know what is exactly going wrong.
Thanks for the help it worked perfectly .