How can i count events section wise in per timeslot?


How can I count events section-wise per timeslot in the unit view?


Hello @Rijwan_Mohammed,

As I understand, you want to count events based on their units and dates, am I right?

If it’s so, you can do it using the getEvents(startDate, endDate) method:
which allows you to count events by date range.

After that, you will be able to map through the array of the events and count them based on their “unit” unit properties, the coded may look like follows:

function countEventsSec(){ 
  var evs = scheduler.getEvents(new Date(2020,5,29),new Date(2020,5,30));
  var aSec = 0, bSec = 0, cSec = 0;
  for (var i=0; i<evs.length; i++){
    if(evs[i].unit_id == 1)
    if(evs[i].unit_id == 2)
    if(evs[i].unit_id == 3)
  console.log("A Section: ", aSec, "B Section: ", bSec, "C Section: ", cSec,)

Here is a demo:

If you meant something different, could you please clarify what exactly you want to count and based on which properties?