![]() |
Date conflict between new event & existed events startDate,endDate
i have a add button and three text boxesfrom where the user will Add eventName,event startDateand ,endDate. now while adding the java script must check wheather the new events date are falling inside of any other events duration time.
as example if first event is from 05/01/22012 to 10/01/2012 , then the second event must start and also comolete BEFORE 05/01/22012 or else second event must start and comolete AFTER 10/01/22012 and for each new event entry javaScript should check with all previous entry. and at last i have to show the varified events in a dynamic table i am a new learner of java script, so please if you can add some code with reply. thanks for reading my problem and also heartfull thanks in advance for your valuable reply. |
There is quite a lot of code involved in this. Here is an outline to point you in the right direction. Essentially you need to convert your dates into Javascript Date Objects so that a comparison can be made.
But you must still ensure that the input is valid - only valid dates (not 31st February), in the right format dd/mm/yyyy, and that the end date is after the start date. I leave that to you. I have invented data for the first three items. This outline should move you forward:- Code:
If you closed your eyes you wouldn't be able to tell which was the Premier League team - Commentator Radio 5 Live |
| All times are GMT +1. The time now is 05:28 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.