We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

When using GetRecurrenceDateTimeCollection if the RRule passed in does not contain a "COUNT=x" then the recurrence will not return anything

As I was manually getting the Recurrences, I was using the SyncFusion method of GetRecurrenceDateTimeCollection, to get the recurrences within the visible range of the SfSchedule.

I noticed that when using this method the RRule for an indefinite recurrence, never returns any appointments, in v17.1.0.40.

For example an RRule of: FREQ=WEEKLY;BYDAY=TU;INTERVAL=2 will not return any values
whereas an RRule of: FREQ=WEEKLY;BYDAY=TU;INTERVAL=2;COUNT=5 will return values.

I noticed in v17.1.0.32 there was apparently a fix for this using NoEndDate, is this a value I need to pass in or something?

Cheers, Akin

4 Replies

DY Deivaselvan Y Syncfusion Team April 10, 2019 01:09 PM UTC

Hi Akin, 
 
Thank you for contacting Syncfusion support. 
 
We have analyzed the reported behavior “GetRecurrenceDateTimeCollection method doesn’t return any data when the NoEndDate recurrence set” and it works fine as expected from our end, we have prepared a simple and added an recurrence appointment by using the rule you have mentioned and it works fine as expected in all the applicable view. 
 
To get the data for the required range you need to pass the range start date and range end date to the GetRecurrenceDateTimeCollectionMethod. 
 
In our sample we have get the recurrence date time collection for the visible date ranges by using the VisibleDatesChangedEvent, and in this event we have pass the visibledate range from the VisibleDatesChangedEventArgument, and we have pass the start range by modifying the time to start of the day as it returns the current time as the value and the appointment start time may fall before the time. 
 
Code snippet: 
C# 
 
private void Schedule_VisibleDatesChangedEvent(object sender, VisibleDatesChangedEventArgs e) 
        {  
            var app = (schedule.DataSource as ScheduleAppointmentCollection)[0]; 
            var startDate = e.visibleDates[0].Date; 
            var endDate = e.visibleDates[e.visibleDates.Count - 1]; 
            var appointments = schedule.GetRecurrenceDateTimeCollection(app.RecurrenceRule, app.StartTime, startDate, endDate); 
        } 
 
Sample: Schedule 
 
Note: As you mentioned we have included this fix in our Volume 1 Beta release version 17.1.0.32, hence kindly update to our latest version to resolve the issue. 
 
If the sample doesn’t meet your requirement, kindly revert us by modifying the sample and share more details and replication procedure which help us to analyze and resolve the reported issue. 
 
Regards, 
Deivaselvan 



AG Akin Goktepe April 12, 2019 01:57 AM UTC

Hi Deivaselvan,

I've used your sample and narrowed down the problem.

I've been following the instructions in the following link: https://help.syncfusion.com/xamarin/sfschedule/recurrence

Our implementation looks something like follows:


var occurences DependencyService.Get<IRecurrenceBuilder>(DependencyFetchTarget.GlobalInstance).GetRecurrenceDateTimeCollection(appointment.RecurrenceRule, appointment.StartDate, rangeStartDate, rangeEndDate);

where the rangeStartDate is the first day of the current month, and the rangeEndDate is the last day of the current month.

Even when using the following 

var occurences DependencyService.Get<IRecurrenceBuilder>(DependencyFetchTarget.GlobalInstance).GetRecurrenceDateTimeCollection(appointment.RecurrenceRule, appointment.StartDate);

I still get no values, unless I have a "COUNT=x" as part of the RRule being passed in (appointment.RecurrenceRule)

Thanks, Akin


AG Akin Goktepe April 12, 2019 06:29 AM UTC

Hi Deivaselvan,

I've figured out the problem. My host application was running a lower version of SyncFusion, it works as expected after upgrading the host app to 17.1.0.40

Thanks, Akin


SP Subburaj Pandian Veluchamy Syncfusion Team April 12, 2019 08:39 AM UTC

Hi Akin,   
     
Thank you for the update. We are happy that the mentioned issue resolved at your end. 
 
Please get in touch with us if you would require any further assistance. 
 
Regards,
Subburaj Pandian V 


Loader.
Live Chat Icon For mobile
Up arrow icon