Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by se7en on Oct 09, 2009 08:14
open dhtmlx forum
Schedule _ How to go to current hour in day view when load page

Hi guys'n'gurls,

Any possibility to start at a specified hour, or specially at the actuall hour when i star tin day view?
Can't find that function|option in the Docs...

Greez from Greece
se7en
Answer posted by Stanislav (support) on Oct 09, 2009 08:30
If you need to adjust view
        scheduler.config.first_hour = 7; // set min time on hour scale
If you need to adjust scrolling state
        scheduler.config.scroll_hour= (new Date()).getHours(); //scroll to actual hour

be sure to place such code before scheduler.init 

Answer posted by se7en on Oct 09, 2009 10:03
Woaw, that was really fast answer, thanks!
It works :)

I just meant the second instruction, to scroll directly there :) Am I also able to configurate the links, for example from month view, to scroll directly to tha actuall hour (when actuall day is clicked) ?

Hint: I used the script someone postet in this Knowledge Base before to make all day names linkable from week and month view :-)
Answer posted by Benjamin on Oct 09, 2009 10:16
Hey se7en,

when i use this kind of snippet, everytime i press a link like in week or month view, or even when i click on the NEXT arrow on top, it jumps to the hour i declare...
But i don't want it to :) Really not ;)
Is it possible to just jump ONCE to the actuall hour and after init the Scheduler delte this command? :/

btw: Nice feature, i will use it also if it works...  I mean, there is no logic for me justebcaus enow it is 19 o clock in Germany, to jump to 19o'clock when i want to check what are my dates tomorrow...
Answer posted by Stanislav (support) on Oct 12, 2009 07:15
>>for example from month view, to scroll directly to tha actuall hour
The setting affects all page changing operation, so scrolling will be applied automatically if you changing mode from "month" to "day"
Answer posted by Stanislav (support) on Oct 12, 2009 07:19
>>Is it possible to just jump ONCE to the actuall hour and after init the Scheduler delte this command? :/

scheduler.load(some_url,function(){
         scheduler.config.scroll_hour = 0;  //disable the option after data loading
})