Jump to content

Time Comparison


jeeva

Recommended Posts

hi frnds

 

i need ur help...

i have a form thats called Conference Room Booking. In that  i need to asking the user to select the between time(like 5:30 to 6:30)

Everything is ok. now my problem is i shud not allow the user to select the same time. for example

Another user has been requseted the time between 5:30pm to 6:30pm .Now i shud not allow the following times

thats

4:30 to 5:00

5:30 to 6:00

and so on

 

i tried to solve this problem but i couldn't get the idea for that...

 

any one have solved the same problem? if Yes let me know please...

 

 

jeeva

 

Link to comment
Share on other sites

There was a similar question asked last week, and here's what we came up with. There is a method you need to follow that will give you what you're after. Let's say that you have the user input their start and end dates: you need to run a query and see if any of four things are true of the date range inserted:

 

  • Does the start time lie within the range of any existing events?
  • Does the end time lie within the range of any existing events?
  • Do any existing start times lie within the range of this new event?
  • Do any existing end times lie within the range of this new event?

 

If these four checks all return FALSE, you have a clean range, and you can successfully insert it into your schedule.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.