Hi To All,
Just want to share how I made the prevention of scheduling into the past dates. Please note the use of jquery.dateFormat-1.0.js plug-in.
/**
* prevent scheduling into the past dates via dragging
*/
scheduler.attachEvent("onBeforeEventChanged", function(event_object, native_event, is_new)
{
start_date = $.format.date(event_object.start_date, "yyyy-MM-dd");
curr_date = new Date();
curr_date = $.format.date(curr_date,"yyyy-MM-dd");
if (curr_date > start_date) {
return false;
}
return true;
});
/**
* prevent scheduling into the past dates via form editing
*/
scheduler.attachEvent("onEventSave",function(id,data,is_new_event)
{
curr_date = new Date();
curr_date = $.format.date(curr_date,"yyyy-MM-dd");
start_date = $.format.date(data.start_date, "yyyy-MM-dd");
if (curr_date > start_date)
{
alert('WARNING! curr_date: '+curr_date+ ' > start_date: '+start_date);
return false;
}
return true;
});
Cheers!