How to get all reoccurrences dates from scheduler.

Hello All,

Could you please tell me how we can get all reoccurrences dates at the time of creating the record?

I want to get all dates from the start date till occrance. I want to get all repeated dates.



1 Reply

VD Vinitha Devi Murugan Syncfusion Team July 29, 2021 07:00 AM UTC

Hi Rahul, 
 
Greetings from Syncfusion Support. 
 
We have validated your reported query “how we can get all reoccurrences dates at the time of creating the record” and achieved your requirement by using actionBegin event of our scheduler and  getRecurrenceDates method. We have prepared the below sample for your reference.  
 
 
  actionBegin: args => { 
    if (args.requestType == 'eventCreate') { 
      let data = args.data[0]; 
      if (!isNullOrUndefined(data.RecurrenceRule)) { 
        const recurrenceElementEJ2Instance = document.querySelector( 
          '.e-recurrenceeditor' 
        ) as EJ2Instance; 
        const recurrenceObjRecurrenceEditor = recurrenceElement 
          .ej2_instances[0as RecurrenceEditor// Here we are taking the recurrence object 
        // Here we get all occurrences dates using getRecurrenceDates method 
        let occurrenceDateany = recurrenceObj.getRecurrenceDates( 
          data.StartTime, 
          data.RecurrenceRule 
        ); 
        console.log(occurrenceDate); 
      } 
    } 
  } 
 
Kindly try with the above sample and get back to us if you need any further assistance 
 
Regards, 
Vinitha 


Loader.
Up arrow icon