limit violations change the end time


#1

Hi there.

We’ve set up blocked areas on our calendar. When we drag or click on the blocked area, we are correctly blocked from creating a new event at that time.

However, when we create an overlapping event by starting before the blocked time and dragging into the blocked area, instead of simply blocking the new event it changes the end time of the new event so that it no longer overlaps.

For example:
If I block from 10am to 5pm and I drag to create an event from 9am to 11am, a new event is created from 9am to 10am - effectively changing my end time. I’d rather it just reject the request and not trigger the new event at all.

I tried this, but it doesn’t seem to make a difference:

scheduler.attachEvent("onLimitViolation", function (id, obj){ return false; });


#2

Hello,

To disable changed start and dates when onLimitViolation fires, you need make some changes at dhtmlxscheduler_limit.js file.
Add ‘return false’ in the following conditions:

github.com/DHTMLX/scheduler/blo … it.js#L146
github.com/DHTMLX/scheduler/blo … it.js#L155

Demo:
docs.dhtmlx.com/scheduler/snippet/c9c9e2c7


#3

Hi, this is an old topic but I found it by looking for a “better” solution than modifying the function you mentioned (as I debugged it before I knew what to look for, I just secretly hoped I missed something and there may be a better way).

I am actually modifying the checkInMarkedTimespan (overwriting the fn in my files) but for that I also need getZones. Doesn’t matter, anyway, it works. But overriding/overwriting like this is very inconvenient.

Could you PLEASE make this an config option? Looking at your code, this should be absolutely no problem (it literally looks like work for a few minutes, just add a config check in the condition).

Feedback (as always) appreciated. Thanks.


#4

Hello @fxfn,

Thank you for the suggestion, I sent a request to our dev team and they will consider updating this functionality in future updates, unfortunately, there is no ETA.