Get the startdate and enddate of the current view in scheduler with react functional component.

I'm trying to get the startdate and enddate of the current view in scheduler but did not found any way using react.

3 Replies 1 reply marked as answer

PN Praveenkumar Narasimhanaidu Syncfusion Team June 1, 2021 11:47 AM UTC

Hi Ariff, 

Greetings from Syncfusion support..! 

We have validated your requirement “Get the startdate and enddate of current view” at our end and let you know that, you can achieve this requirement with the help of scheduler’s getCurrentViewDates method. We have prepared a sample for your reference which can be downloaded from following link. 
App.tsx 
 const onDataBinding = (argsany=> { 
    var scheduleObj : any = (document.querySelector(".e-schedule"as any).ej2_instances[0]; 
    var currentViewDates : Date[] = scheduleObj.getCurrentViewDates(); 
    var startDateDate = currentViewDates[0]; 
    var endDateDate = currentViewDates[currentViewDates.length-1]; 
 
    console.log("current view start date: "startDate); 
    console.log("current view end date: "endDate); 
  } 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Praveenkumar 


Marked as answer

AR Ariff June 2, 2021 05:59 AM UTC

Thanks! It works!



NR Nevitha Ravi Syncfusion Team June 3, 2021 04:35 AM UTC

Hi Ariff, 
 
You are most welcome..! please get back to us if you need any assistance. 
 
Regards, 
Nevitha 


Loader.
Up arrow icon