Ej scheduler 2 Recurring Events

I am making appointment booking system.And I migrated from Ejschedule 1 to ejschedule 2.I am getting issue to keep track of recurring events on backend.If I make a recurring event that containing six appointments on different dates.Some one come and booked 1 how can I keep track that this appointment is booked and other 5 are not booked.As we have only recurrence rule in ejscheule 2.Is there any flag or unique id against each recurring appointment so I can keep track that this appointment is booked or other recurring appointments are not booked.

How can we track individual recurring instance?

Is there any unique footprint to recurring instance?

1 Reply

VM Vengatesh Maniraj Syncfusion Team April 16, 2020 12:29 PM UTC

Hi Awais, 

Greetings from Syncfusion Support. 

How can we track individual recurring instance? 
We could track the individual reccurrences by making use of scheduleInstance.eventBase.getOccurrencesByID. Please refer the above code snippet. 

Is there any unique footprint to recurring instance? 
We have used only the RecurrenceID field for recurrence appointments. 

We have validated your shared details and we suspect that your requirement is to track the individual occurrences whether this is booked or not. We have to clarify the functionality of the recurrence events is that it renders all the occurrences in its series for example, if we render the recurrence event that contains six events, it should render all the six events but it maintain only one event object in its backend. And the recurrence rule does not maintain any unique id to identify that the appointment is already booked or not. But we can find which recurrence event is rendered in the same slot like below code, 

 actionBegin: function(args) { 
    if ( 
      args.requestType === "eventCreate" || 
      args.requestType === "eventChange" 
    ) { 
      var data = void 0; 
      if (args.requestType === "eventCreate") { 
        data = args.data[0]; 
      } else if (args.requestType === "eventChange") { 
        data = args.data; 
      } 
      if (!scheduleObj.isSlotAvailable(data)) { 
        var startTime = args.data[0].StartTime; 
        var endTime = args.data[0].EndTime; 
        //Get the rendered events 
        var bookedEventObject = this.eventBase.filterEvents(startTime, endTime); 
        //Get the booked recurrence ID 
        var bookedRecurrenceId = bookedEventObject[0].RecurrenceID; 
        //Get the Individual occurrences 
        var bookedOccurrenceLists = this.eventBase.getOccurrencesByID(bookedRecurrenceId); 
        //prevent the save event. Because already booked 
        args.cancel = true; 
      } 
    } 
  } 

Note: isSlotAvailable method is used to find that the slot is already booked or not. 
 
For your reference, we have prepared the sample with CRUD actions which is available in below link 

 
Kindly check the above and get back to us if you need any further assistance. 
 
Regards, 
Vengatesh  


Loader.
Up arrow icon