Extending a job over a lunch break

Hi all,

I am new here, first time post and I hope someone can help me.

We are using dhtmlx scheduler to schedule jobs. When a job is dropped to a timeslot and it goes into a lunch break the job should be allowed to be dropped there and extended with the time of the lunch break.

Does anyone have any ideas on how to make this happen?




if you have a marked timespan for lunch time, for ex.:

scheduler.addMarkedTimespan({ days: "fullweek", zones: [12*60, 13*60], css: "highlight_section" });
and your event drop into this slot, you can redefine the event length only manually, just attach appropriate event listener, for ex.:

scheduler.attachEvent("onBeforeEventChanged", function(ev, e, flag, ev_old){ var condition; // check if event cross your lunch time by comparing dates if(condition){ ev.end_date.setHours(ev.end_date.getHours() + 1); // for 1 hour lunch break scheduler.updateEvent(ev.id); } return true; });