I want to forbid drag&drop for events which are older than 15m.
Therefore I created the following:
scheduler.attachEvent("onBeforeDrag",function(event_id, native_event_object){
if(scheduler.getEvent(event_id).created!=""){
var today=new Date();
var match = scheduler.getEvent(event_id).created.match(/^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$/);
var created=new Date(match[1], match[2]-1, match[3],match[4],match[5],match[6]);
return (today.getTime()-created.getTime())/60000<=15;
}});
On the one side the code forbids the dragging but on the other side the creation of new events gets a bit weird. For example when I click at the start time for an event and create an area of 2 hours and leave the mouse button the lightbox isnt shown but I can still change the area of the event (as if the button is still pressed)
So I think something in my code is wrong.
Can you help me please?