function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Himanshu Verma 9Himanshu Verma 9 

When user click on button how to redirect the calendar view on selected date field in visualforce page?

Hi,
If the User enters a date in the Selected Date field and presses the 'Go' button, then the system centers the calendar view on the date that was entered. How to achieved this?
Rohit K SethiRohit K Sethi
Hi ,

Use below js function to redirect to calender view page : 
function f1(){
    
      //Set Date value on which you want to switch.
    var dt = new Date();
    
    var timestmp = dt.setFullYear(dt.getFullYear(), 0, 1);
    var yearFirstDay = Math.floor(timestmp / 86400000);
    var today = Math.ceil((new Date().getTime()) / 86400000);
    var dayOfYear = today - yearFirstDay;
    calYear = new Date().getFullYear();      
    var calUrl = "/00U/c?cType=1&md3=" + dayOfYear + "&md0=" +  calYear ;
    window.location = calUrl;
    return false;
}
Thanks.