scheduler.blockTime with serverList


I am trying to set blocked times using serverList. If this is not the correct method, please advise.

var operating_times = scheduler.serverList(“operating_times”);

After the above is executed, operating_times.length is 0, and I assume this is why a
for (i in operating_times) {} is not running.

If I try run the for loop in scheduler.attachEvent(“onOptionsLoad”, function (){}, it works fine. Doing it this way however adds the blocked div multiple times and results in the opacity of the default gray block becoming a solid gray.

Thank you


This command doesn’t load the data immediately. It registers variable and will fill it with data when event will be loaded in scheduler. So if you want to do something with operating_times collection, you need to run that code from after load callback.

scheduler.attachEvent("onXLE",function(){ do_something(); }); //or scheduler.load(url, function(){ do_something(); });

Hi Stanislav

Before running scheduler.load( //something ) the collection does have the expected data in it. It appears to be a object of objects and I cannot iterate through that. After scheduler.load() I can iterate through it.

I used to iterate through the collection inside scheduler.load() but after upgrading to 3.5 the blockTime overlay (default gray color) eventually looses it opacity. This is because it now creates multiple blockTime divs every time I refresh data.

Is the latter perhaps a bug that then needs to be fixed?


Please use the attached file as demonstration. Simply replace the existing sample file in the 3.5 BETA release.

Claus (1.81 KB)


Before applying new timeblocks you can delete previous ones:

Check blocking and highlighting time sections article in our documentation.
blockTime is a synonym to addMarkedTimespan now. Though you can use unblockTime as well (synonym to deleteMarkedTimespan).

Also note that for this case:


you can omit parameters, current ones will be used by default:


Best regards,

Was anyone able to come up with an elegant solution for this problem. This is similar to something I’m trying to figure out - using a set of db records with start/end times as input to addMarkedTimespan, markTimespan or blockTime. I could use a hand, as I’m a newbie to this.
Thanx in advance,