Extend/Move an Event

Hi, I’m currently allowing events to go through blocked days and times provided the start/end of the event does not land on a blocked time. I’m using the following code to do so:

//fires when the user tries to create an event through a timespan that is currently limited/blocked
	scheduler.attachEvent("onLimitViolation", function  (id, event){
		
		if(event.probe) return false;
		
		var allowedStart = scheduler.checkLimitViolation({
			start_date:event.start_date,
			end_date: scheduler.date.add(event.start_date, scheduler.config.time_step, "minute"),
			probe:true//checkLimitViolation invokes onLimitViolation event. Add a property to detect when it's happens by our call
		});
		
		var allowedEnd = scheduler.checkLimitViolation({
			start_date:scheduler.date.add(event.end_date, -scheduler.config.time_step, "minute"),
			end_date: event.end_date,
			probe:true
		});
				
		if(allowedStart && allowedEnd){
			return true;
			}else{
			return false;
		}
	});

I’m currently having 2 problems with this. The first is that although it allows the addition of an event through the blocked times it will not show the lightbox on creation of the event. The second is once an event has been created and lays through a blocked timespan it will not allow me to extend or move the event. I’m assuming there is an event catching the drag event and returning false if it is on a blocked timespan. I just don’t know which one. Any help would be greatly appreciated.

Thank you

For anyone with a similar questions I’ve decided to take a different approach which seems to have solved my problem. Code below should explain enough. If not please feel free to send me a PM.

[code] scheduler.attachEvent(“onBeforeEventChanged”, function(ev, e, is_new){

	var blockedStart = scheduler.checkInMarkedTimespan({
		start_date: ev.start_date,
		end_date: scheduler.date.add(ev.start_date, scheduler.config.time_step, "minute")
	}, "closed");
	
	var blockedEnd = scheduler.checkInMarkedTimespan({
		start_date:scheduler.date.add(ev.end_date, -scheduler.config.time_step, "minute"),
		end_date: ev.end_date
	}, "closed");
	
	if(blockedStart || blockedEnd){
		return false;
	}else{
		return true;
	}
});

[/code]

Hi,
thanks for your assistance!