Scheduler - How can I programmatically detect the overlapped operations

Hello,
I have to detect the overlapped operation that is "under" the other. In the case in example BELLEVUE.
I have to change color, and also set some boolean in my model.
There is a properties or some appointment field that I can use to do it?



5 Replies 1 reply marked as answer

NR Nevitha Ravi Syncfusion Team December 21, 2020 11:47 AM UTC

Hi Gabriele, 

Greetings from Syncfusion Support. 

Q1: detect overlap events 
You can check the overlapping of events with isSlotAvailable public method, in the following UG we have prevented the appointment creation of check availability. 

Q2: Change color and have custom fields 
You can change the appointment color and have custom fields for the appointments, please refer to the following UG links. 

Please refer the above links and get back to us if you need any further assistance. 

Regards, 
Nevitha 



GG Gabriele Guidi December 21, 2020 12:12 PM UTC

Thanks Nevitha,
your advice solve part of my problem,
but I need also to know who is the "under" and who is the "upper".

in my example I have to identify the BELLEVUE.


RV Ravikumar Venkatesan Syncfusion Team December 22, 2020 08:07 AM UTC

Hi Gabriele, 

Thanks for the update. 

We have validated your requirement at our end. We have achieved your requirement with the help of the filterEventsByRange method of the Schedule as shown in the below code and for that, we have prepared a sample for your reference which can be viewed from the following link. 

 
[index.js] 
  eventRendered: args => { 
    let data = args.data; 
    let eventsInTimeRange = scheduleObj.eventBase.filterEventsByRange(scheduleObj.getCurrentViewEvents(), data.StartTime, data.EndTime); 
    for (let i = 0; i < eventsInTimeRange.length; i++) { 
      if (data.Id === eventsInTimeRange[i].Id && eventsInTimeRange[+ 1]) { 
        // Printing the event data under the current event 
        console.log(eventsInTimeRange[+ 1]); 
        break; 
      } 
    } 
  } 

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

Regards, 
Ravikumar Venkatesan 


Marked as answer

GG Gabriele Guidi December 23, 2020 03:22 PM UTC

Thanks,
it works, in your example it was considered as overlapped appointment also if the two appointmens belongs to different resources.
But the idea is good and with little adjustment it works for me,

Regards  


VM Vengatesh Maniraj Syncfusion Team December 24, 2020 06:54 AM UTC

Hi Gabriele, 

Thanks for the update. 

we are happy that our solution has worked for you. 

Please get back to us if you need any further assistance. 

Regards, 
Vengatesh  


Loader.
Up arrow icon