HI,
Am planning to write a event management for my web application ,where the Admin can schedule a program to one particular channel say like Admin --> BBC channel --> 10Am-12Am program one from 12 Dec2014 - 23DEC 2014 ..Now my question is when i write checking condition as no other program shud be allocated for the same time or if the admin selects as 9:30 Am -12Am it should pop error msg as 10-12 is already taken.
I have done by checking the present time 10-12 it works roght but when i chk with 30 mins before it gets created which is not effective as two prg in same ..same channel ..Any idea whould be helpful.Thanks for your time on reding this long question..

I am not sure what the check is doing, but, IMO, you need to define the program a a single insatance running, and check at the beginning if another instance is running then shutdown the current one.

I would suggest this article for that purpose.

Hope this helps

You need to check if part of the time periods overlap. In general, with events a and b: overlap = a.start < b.end && b.start < a.end;

Hi, Thanks for the reponse. I fixed up by reading the data from the DB and fetch only the hour from them and just pass the runtime value say like 10AM to 12AM in a loop and checked with DB read value and returned the result ..its done .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.