We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Default Time of Calendar: View when user comes to the page should move the calendar view such that “Now” is in middle

So when user comes to the scheduler page always current time should be display. As of now when we come to scheduler page, it always show the view from startTime.Let's take if out start time is 8AM and current time is 5pm then when we come to scheduler page 5pm should be display in the middle.How can we do it >??

7 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team October 31, 2019 04:49 AM UTC

 
Syncfusion greetings. 
 
Kindly refer the below UG link to achieve your requirement. 
 
Regards, 
Karthi 
 



SJ Sudhanshu Jain November 4, 2019 12:04 PM UTC

Above solution is not working .i have added below method on event "created".
onCreated() {
this.scheduleComponentObj.scrollTo(this.instance.formatDate(new Date(), { skeleton: 'hm' }));
}

It is giving below error .

TypeError: Cannot read property 'scrollToHour' of undefined.


VD Vinitha Devi Murugan Syncfusion Team November 5, 2019 10:27 AM UTC

Hi Sudhanshu, 
 
Syncfusion Greetings. 
 
We tried to reproduce your reported scenario at our end, but scrolling working fine on initial load at our end. We have prepared a sample for your reference which can be available in below link. 
 
 
 onCreated() { 
        this.scheduleObj.scrollTo(this.instance.formatDate(new Date(), { skeleton: 'Hm' })); 
    } 
 
                                                                                                                                               
Regards, 
M.Vinitha devi 



SJ Sudhanshu Jain November 5, 2019 11:17 AM UTC

Above same thing i am trying but getting error .Can we setup a call .i have another issue also.so we can discuss and get on the same point .




VD Vinitha Devi Murugan Syncfusion Team November 6, 2019 06:43 AM UTC

Hi Sudhanshu, 
 
Thanks for your update. 
 
We suspect that in your sample you are using the resource. In resource sample, promise will be resolved slower compared to default sample. Therefore, only unable to get the Schedule instance in created event which is the cause for the issue. Kindly use dataBound event as below.  
 
 
onDataBound() { 
        this.scheduleObj.scrollTo(this.instance.formatDate(new Date(), { skeleton: 'Hm' })); 
    } 
 
Regards, 
M.Vinitha devi 



SJ Sudhanshu Jain November 6, 2019 11:24 AM UTC

Thanks it is working .You can close the incident .


VD Vinitha Devi Murugan Syncfusion Team November 7, 2019 07:05 AM UTC

Hi Sudhanshu, 
 
You are most welcome 😊 
 
Regards, 
M.Vinitha devi    


Loader.
Live Chat Icon For mobile
Up arrow icon