How to find an instance of a recursive meeting on a future date

Hi there,

I've created a single meeting for a specific day and a recursive meeting occurring on that same day as well but starting earlier and all works fine. When I try to find all meetings on that specific day (1 fixed and 1 instance of the recurring meeting), I only get the fixed meeting. Only when I ask for the meetings on the same day the recurring meeting started, then I receive both fixed and an instance of the recurring meeting.

In attachment an application to show how I approached the Scheduler control. Can you show me how to get an occurrence of the recurring meeting on a later date than the one used to create it.

Thanks for your help,
Pascal Desmet


Attachment: SchedulerQuestion_92bc3d70.zip

4 Replies 1 reply marked as answer

MS Muniappan Subramanian Syncfusion Team May 23, 2022 01:53 PM UTC

Hi Pascal,


Currently, we are analyzing your requirement “How to find an instance of a recursive meeting on a future date” in SfScheduler. We will update you with further details on or before May 25th, 2022. We appreciate your patience until then.


Regards,

Muniappan S



MS Muniappan Subramanian Syncfusion Team May 25, 2022 03:38 AM UTC

Hi Pascal,


#Regarding How to find an instance of a recursive meeting on a future date

You can achieve your requirement by using the GetDateTimeOccurrences from the SchedulerRecurrenceManager in the SfScheduler. The GetDateTimeOccurrences method is used to get the date-time collection at which the recurrence appointment will occur. We have updated the sample and please find the attached sample for the same.


Code snippets:

private void ShowInfo()

{

    var meetingsOnInfoDate = new ObservableCollection<Meeting>();

    var startDate = CurrentDate;

    var endDate = CurrentDate;

    foreach (Meeting app in Meetings)

    {

        if (app.RecurrenceRule != null)

        {

            IEnumerable<DateTime> dateCollection = SchedulerRecurrenceManager.GetDateTimeOccurrences(app.RecurrenceRule, app.From);

            if (dateCollection.Any(d => d.Date == startDate.Date))

            {

                meetingsOnInfoDate.Add(app);

            }

        }

        else if (app.From.Date == CurrentDate)

        {

            meetingsOnInfoDate.Add(app);

        }

    }


    if (meetingsOnInfoDate == null)

    {

        InfoText = "No meetings on this date";

    }

    else

    {

        InfoText = $"Meetings on this date: {CurrentDate.ToString("dd/MM/yyyy")}";

        foreach (var meeting in meetingsOnInfoDate)

        {

            InfoText += "\n" + meeting.EventName;

        }

    }

}


Please find the output for the same,

Screen Shot 2022-05-25 at 9.04.46 AM.png


We hope this helps. Kindly revert us if you have any concerns.


Regards,

Muniappan S.


Attachment: Scheduler_Appointments_54b9d02f.zip

Marked as answer

PD Pascal Desmet May 27, 2022 03:11 PM UTC

Hi Muniappan and fellow Syncfusion users,

As addendum, I could have found the answer in the documentation if I had read it more in detail at this page:
Appointments in .NET MAUI Scheduler control | Syncfusion


How to get the recurrence dates from RRULE?

The GetDateTimeOccurrences method of .NET MAUI Scheduler retrieves the occurrences date-time list from the RRULE.

var dateTime = DateTime.Today.AddHours(10);
var recurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=3";
var dateCollection = SchedulerRecurrenceManager.GetDateTimeOccurrences(recurrenceRule, dateTime);

/// The following occurrence dates can be retrieved from the given RRULE:
var date1 = 12/14/2021 10:00:00 AM;
var date2 = 12/15/2021 10:00:00 AM;
var date3 = 12/16/2021 10:00:00 AM;

kind regards,

Pascal Desmet



SS SaiGanesh Sakthivel Syncfusion Team May 30, 2022 10:51 AM UTC

Hi Pascal,


We are glad to know that the provided solution is resolved the query. Please let us know if you need any further assistance on this. 


Regards, 

SaiGanesh Sakthivel


Loader.
Up arrow icon