Hi Muhaiminul,
Greetings from Syncfusion Support.
We have validated your reported query “Let me know if there's any helper method for getting a list of ongoing events of a particular date from the server-side” and you can get the list of ongoing events of particular date with the help of RecurrenceHelper utility. Please refer below UG link for more information..
We have prepared below sample for your reference with RecurrenceHelper utility.
public List<ScheduleEvent> LoadData([FromBody]Params param)
{
var data = _context.ScheduleEvents.ToList();
DateTime startdate = DateTime.Today;
DateTime enddate = startdate.AddDays(1);
List<ScheduleEvent> appCollection = new List<ScheduleEvent>();
for (var i =0; i< data.Count; i++)
{
var app = data[i];
if (data[i].RecurrenceRule != null) {
TimeSpan diff = app.EndTime.Subtract(app.StartTime);
var recurrenceRule = data[i].RecurrenceRule;
TimeSpan startDiff;
var dateCollection = RecurrenceHelper.GetRecurrenceDateTimeCollection(recurrenceRule, app.StartTime);
foreach (var date in dateCollection)
{
startDiff = app.StartTime.Subtract(date);
break;
}
foreach (var date in dateCollection)
{
var start = date.Add(startDiff);
var end = start.Add(diff);
appCollection.Add(new ScheduleEvent { Subject=app.Subject, StartTime = start, EndTime = end, CategoryId=app.CategoryId, Description = app.Description, IsAllDay =app.IsAllDay, RecurrenceRule = app.RecurrenceRule, Location = app.Location,ProjectId = app.ProjectId, StartTimezone = app.StartTimezone, EndTimezone = app.EndTimezone,Id = app.Id });
}
}
else
{
appCollection.Add(app);
}
}
// Here we fileter the today appointment from the db
var todayAppointmentCollection = appCollection.Where(app => (app.StartTime >= param.StartDate && app.StartTime <= param.EndDate)).ToList();
Console.WriteLine(todayAppointmentCollection); // Now the today appointment available in 'todayAppointemntCollection variable.'
return data;
}
Kindly try with the above solution and get back to us if you need any further assistance
Regards,
Vinitha