In a form I have one Date text field and 2 dropdowns: Start time and End Time with 30-minutes time interval.
- One user selects time 9:00:00 – 11:00:00
- The second user selects time 1:00:00 – 3:00:00
- The Third user wants 8:00:00 – 16:00:00
The third user was able to select the time frame that overlaps with the first two users.
Is it possible to compare and validate these times using jquery?
The application is in asp.net mvc. It includes fullcalendar.js plugin.
Thank you very much for your advise!
I don’t think there is a way to directly do this with jQuery, but this is the general algorithm I would use to solve this:
Assuming the smallest increment of time is an hour, every user selects a set of numbers, each number ranges from 0-23 (representing the hour). Then, if the first 2 users have selected sets A and B, then the third user should only be allowed to choose from the intersection of the two sets i.e A AND B. You can generalize this to any number of users.