scheduler - limit the Start & End time dropdown values from

Hi,

I have limited my day view to display schedules from 8 AM to 5 PM. However when I modify/create a new event, I see all the possible time values in the Lightbox i.e. from midnight to 12 AM.



How can I limit these dropdown values in the Lightbox as well from 8 AM to 5 PM or any other configurable value?



Thanks


Hello,


you can try to apply the following approach


var setter = scheduler.form_blocks.time.set_value;
scheduler.form_blocks.time.set_value = function(node,value,ev){
var selects = document.getElementsByTagName(“select”);
selects[0].innerHTML = “”;
selects[4].innerHTML = “”;
var date = new Date();
var dt = new Date(date.getYear(),date.getMonth(),date.getDate(),8,0);
for (var i=608; i<6017; i+=this.config.time_step*1){
var time=this.templates.time_picker(dt);
selects[0].options[selects[0].options.length] = new Option(time,i);
selects[4].options[selects[4].options.length] = new Option(time,i);
dt=this.date.add(dt,this.config.time_step,“minute”);
}
setter.apply(this,arguments);
}




Thanks for the quick reply. Tried this, but the line below, is causing an error - ‘Object doesnt support this property or method’.



this.templates.time_picker(dt)



Any idea? I’m currently using version 2.



 



 



 

time_picker template has been provided since 2.1 version.