dhtmlx scheduler and double click default

On the calendar, when I double-click on month view is there a way to change the default times for an event without altering the click and drag functionailty on the day view.


Hello,


you can redefine time block as follows:



var setter = scheduler.form_blocks.time.set_value;



scheduler.form_blocks.time.set_value=function(node){
var sels = node.getElementsByTagName(“SELECT”);
setter.apply(this,arguments);
if(scheduler._new_event&&scheduler._mode==“month”){
sels[0].value = minutes;


sels[4].value = minutes;
}
}


Where minutes - the default value in minutes. For example 90 or 480.



Almost worked.  I set sels[0].value = minutes;

         sels[4].value = 480;
sels[0].value = minutes;



         sels[4].value = 60;



and the start time is great at 8 AM, but the end time carries me to the next day, the 24th at 1 AM; and if the 2nd argument is 540 it brings me to the next day at 9 AM.


sorry, I menat sel[0].value=480


Locally the following approach works correctly. Dates in from and to blocks show the same days:


var setter = scheduler.form_blocks.time.set_value;

scheduler.form_blocks.time.set_value=function(node){
var sels = node.getElementsByTagName(“SELECT”);
setter.apply(this,arguments);
if(scheduler._new_event&&scheduler._mode==“month”){
sels[0].value = 480;
sels[4].value = 540;
}
}




This is what I am using, still wants to go to the next day.



 




 function init() {
       
        //scheduler.config.readonly=1;
                //scheduler.config.show_loading=true;




                scheduler.config.time_step = 60;
                scheduler.config.multi_day=0;
                scheduler.config.xml_date="%Y-%m-%d %H:%i";
                scheduler.config.hour_size_px=75;
  scheduler.config.lightbox.sections=[ 
   {name:“description”, height:80, map_to:“text”, type:“textarea” , focus:true},
   {name:“location”, height:60, type:“textarea”, map_to:“details” },
   {name:“time”, height:72, type:“time”, map_to:“auto”}
  ]
  
                scheduler.config.first_hour=7;
                scheduler.config.last_hour=19;
                scheduler.config.hour_date="%h:%i%A";



               //Set time on month view on double click
              var setter = scheduler.form_blocks.time.set_value;
              scheduler.form_blocks.time.set_value=function(node){
              var sels = node.getElementsByTagName(“SELECT”);
              setter.apply(this,arguments);
              if(scheduler._new_event&&scheduler._mode==“month”){
              sels[0].value =480;
              sels[4].value =540;
                 }
              }
              //End select default hours on double click


Locally \tThe same code works correctly - sample is attache

sample.zip (37.4 KB)


Alex,



  The sample you provided works fine, but the website implementation fails:



vmcrad.org/xcal/schedules/in … aconf.html



Could it be due to PHP time definition or settings?


Alex,



actually, I uncoverered some other eccentricities:



1.  On the sample, the upper left of the yellow box has a different time on month double click.,



2. On the sample, sometimes double clicking on the month gives a different time



 



On



vmcrad.org/xcal/schedules/in … aconf.html



dragging an event from one box to another changes the time.



quite strange.

Hello,

to solve the issue with time in header you can try to use the following approach:

event_header_old = scheduler.templates.event_header;
scheduler.templates.event_header = function(start_date,end_date,ev){
     if(scheduler._new_event&&scheduler._mode==“month”)
         return “8:00AM - 9:00AM”;
     else return event_header_old.apply(this,arguments);
}
Regarding the others issues with sample on the website -they were not reproduced.


thanks, the sample seems ok, although the version I have:



vmcrad.org/xcal/schedules/in … aconf.html



when I click on the event in month view, the time changes by 1 hour, and when I move from one day to another in month view the time changes again by more that that.  Still quite puzzling.


thanks, the sample seems ok, although the version I have:



vmcrad.org/xcal/schedules/in … aconf.html



when I click on the event in month view, the time changes by 1 hour, and when I move from one day to another in month view the time changes again by more that that.  Still quite puzzling.

Which timezone is configured on your PC ?


pacific time



automatic adjustment for daylight savings

the same problem occurred when I tried a friends computer


Partial debugging follows:



Commenting out line



 //scheduler.config.time_step = 60;



results in not changing to the next day on the web based calendar.



 



The time and date fluctuations when dragging an event from one day to another are peculiar to the month of Nov seemingly.  When I click on a time in month view in the upper part of the box, the time decreases by 1 hour, and when I drag the same thing happens but only for the month of Nov, so this may have to do with daylight savings time.  The are some php bugs in strtotime in the past, or perhaps crossing daylight savings time is not accounted for entirely in the calendar scripts?  When I click and drag on the prior or following month, all is well.


Alex,



additional  note (please see prior also):  When I change the date&time control panel to not correct for daylight savings time automatically the behaviour reverts to expected for the months of Oct or Nov.  I do not think you can assume what another persons computer is set for though.   Is there a way to account for this? thanks,

Hello,

please try to use the latest (attached) scheduler version. There were some fixes for winter time.



dhtmlxscheduler.zip (19.3 KB)


Alex,



  thanks, that solved the problem!