Possible bug with addMarkedTimespan in Unit view.

Hi there,
I’m currently new to javaPlanner and DHMTLXScheduler but I’ve made a lot of progress, right now I’ve got two problems:

1- I want to load the data of block times in my db in a unit view for different units but when I add a new mark addMarkedTimespan with blocking type it clears all the blockings of that day that was previously set in general.
I mean at first I’ve created the working time 8AM-5PM for the units with the following:
scheduler.addMarkedTimespan({days:0,sections:{“unit”:[“1”]},zones:[0, 600,1140, 1440,735, 810],type:“dhx_time_block”});
afterward when I want to add another block time for a single date like this:
scheduler.addMarkedTimespan({days:new Date(2009, 6, 1),html:“UNAVAILABLE”, zones:[10.560, 1160],sections:{“unit”:[“1”]},type:“dhx_time_block”});
It clears all the blocking data of that day and the adds the new one only!
Is this a bug or am I doing something wrong?
I’ve found that I can add those parts again afterwards for this specific date, but if there are a lot of days (which in reality there are) it will make my page to die…
So any advice, or is it a bug that will be addressed later?
Of course I’m doing this with Java code with JavaPlanner but I actually used javascript and got the same error. :ugeek:

2-Are there any way to load these blocking timespans from the db and not on load of the page, forexample exactly list the events themselves that have a dynamic load, is there somekind of functionality for this as well or should I implement something for it? :nerd:

You can also test the first bug in this page of your example:
docs.dhtmlx.com/scheduler/sample … ation.html
add dynamically using a firebug, Chrome Developer Tools or IE Developer tools this code:

scheduler.addMarkedTimespan({days:new Date(2009, 6, 1),html:“Unavailable”,zones:[10.560, 1160],sections:{“unit”:[“1”]},type:“dhx_time_block”});

and you see that on 1 July 2009 (one day after the example itself) in unit view all the block times will be deleted and this new one will be added of course for the first person (James smith) ! :mrgreen:

Thanks again for your help

Thanks a lot for your great work guys.


This is designed behavior, timespans set that are set to specific date overwrites ones for days of week.
So adding timespans for specific day is the only option at the moment.
docs.dhtmlx.com/scheduler/limits … ngpriority

There is no built it way, but if you store them in some database structure, you could load array of timespans configurations via ajax and apply them each time view changes.
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … espan.html
docs.dhtmlx.com/scheduler/api__s … espan.html

Thanks a lot for your reply,
It took me some time but I changed a little bit of your library on my own version and now I can get everything that I need :wink:
As for other resources I found the best solution to load them in to collections and parse them client side with javascript as I use the month fetching this was the best idea that I could come up with, had to add some event’s of my self to the code as well, but at the end of the day your great work was so expandable thanks a lot.