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
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
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,
We hope this helps. Kindly revert us if you have any concerns.
Regards,
Muniappan S.
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
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
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