Check if anybody create an event that ends before it starts

Is it possible that (if you press Save in the lightbox) and you have an event thats ends before it starts, you get an (javascript) error?


Scheduler doesn’t control date end.


You can try to use the following approach to show error message when date is chosen incorrectly:


var setter = scheduler.form_blocks.time.set_value;
scheduler.form_blocks.time.set_value = function(node,value,ev){
s=node.getElementsByTagName(“select”);
for(var i = 0; i < s.length; i ++)
s[i].onchange = checkTime;
setter.apply(this,arguments);
}
function checkTime(e){
var start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
var end_date=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);
if(start_date > end_date) alert(“The end date isn’t correct!”);
}