Counting appointments per day

Is it possible to count appointments per day?

3 Replies

SE Sellakumar Syncfusion Team January 15, 2018 10:32 AM UTC

Hi Wouter, 
 
Thanks for contacting Syncfusion support. 
 
Yes, it is possible to count the appointments per day. By default, there is no default function to count the number of appointments per day, but In workaround solution it is possible to count the number appointment counts in particular day and code snippets as follows: 
 
<code> 
 
        function filterEvents(date) { 
            var schArgs = $('#Schedule1').data('ejSchedule'); 
            var startDate = new Date(new Date(date).setHours(0, 0, 0)); 
            var endDate = new Date(new Date(startDate).setHours(23, 59, 59)); 
            var predicate = ej.Predicate(schArgs._appointmentSettings.startTime, 'greaterthanorequal', startDate). 
                and(ej.Predicate(schArgs._appointmentSettings.endTime, 'greaterthanorequal', startDate)). 
                and(ej.Predicate(schArgs._appointmentSettings.startTime, 'lessthan', endDate)). 
                or(ej.Predicate(schArgs._appointmentSettings.startTime, 'lessthanorequal', startDate). 
                and(ej.Predicate(schArgs._appointmentSettings.endTime, 'greaterthan', startDate))); 
            var filter = new ej.DataManager(schArgs._processed).executeLocal(new ej.Query().where(predicate)); 
            return filter; 
        } 
 
</code> 
 
Kindly try the above code example and revert us with further details, if we have misunderstood your requirement or else if you need any further assistance on this. 
 
Regards, 
Sellakumar K


WO Wouter January 15, 2018 10:42 AM UTC

Thanks a lot. This is just what I needed! Thanks a lot!


VS Velmurugan S Syncfusion Team January 16, 2018 10:14 AM UTC

Hi Wouter

We are glad to hear that our solution fulfilled your requirement. Kindly let us know, if you need any further assistance.  

Regards,
Velmurugan 


Loader.
Up arrow icon