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

Recurrence doesnt work in UWP


Hi,

Code below works in Android but doesnt work in UWP. you can try it as below. you will see that 3 schedules will have same day for each week on UWP. On Android as expected each will be 1 day after another.
 

for (int i = 0; i < 3; i++)
                    {
                        CustomAppointment scheduleAppointment = new CustomAppointment()
                        {
                            Color = Color.FromHex("#FFA2C139"),
                            Subject = i.ToString(),
                            StartTime = DateTime.Now.AddDays(i),
                            EndTime = DateTime.Now.AddDays(i).AddHours(2),
                            IsAllDay = false,
                            IsRecursive = schedule.repeated,
                            Location = schedule.location,
                            Notes = schedule.notes,

                        };
                        if (schedule.totalWeeks > 1)
                            scheduleAppointment.RecurrenceRule = CreateRecurrsiveAppointments(scheduleAppointment.StartTime, scheduleAppointment.EndTime, 4.RecurrenceRule;
                 
                    }

private RecurrenceProperties CreateRecurrsiveAppointments(DateTime StartTime, DateTime EndTime, int totalWeeks)
        {
         
            RecurrenceProperties recurrencePropertiesForAlternativeDay = new RecurrenceProperties();
            recurrencePropertiesForAlternativeDay.RecurrenceType = RecurrenceType.Daily;
            recurrencePropertiesForAlternativeDay.IsDailyEveryNDays = true;
            recurrencePropertiesForAlternativeDay.DailyNDays = 7;
            recurrencePropertiesForAlternativeDay.IsRangeRecurrenceCount = true;
            recurrencePropertiesForAlternativeDay.IsRangeNoEndDate = false;
            recurrencePropertiesForAlternativeDay.IsRangeEndDate = false;
            recurrencePropertiesForAlternativeDay.RangeRecurrenceCount = totalWeeks;
            recurrencePropertiesForAlternativeDay.RecurrenceRule = DependencyService.Get<IRecurrenceBuilder>().RRuleGenerator(recurrencePropertiesForAlternativeDay, StartTime, EndTime);

            return recurrencePropertiesForAlternativeDay;

        }

4 Replies

EM Emil January 27, 2017 12:27 AM UTC

copy paste mistake on the line above

  if (schedule.totalWeeks > 1)
                            scheduleAppointment.RecurrenceRule = CreateRecurrsiveAppointments(scheduleAppointment.StartTime, scheduleAppointment.EndTime, 4).RecurrenceRule;
                 


SP Subburaj Pandian Veluchamy Syncfusion Team January 27, 2017 11:11 AM UTC

Hi Emil, 
 
Thank you for your interest in Syncfusion products. 
Based on the provided information, we have checked and we are unable to reproduce the issue ScheduleAppointment RecurrenceRule in Xamarin Forms (UWP) from our side. We have prepared simple sample based on the code example, please find the below sample. 
 
 
 If the given sample doesn’t meet your requirement, could you please revert to us by modifying the provided sample with more information with its replication procedure to reproduce the issue? It will be helpful for us to analyze on it and provide you a better solution.  
 
Regards,  
Subburaj Pandian V.  



EM Emil January 27, 2017 02:21 PM UTC

Hi, 

your sample is not including what i wrote above. Key part there is for loop. I amended your sample and please run this sample on android and uwp local and mobile to see the difference. I create 3 apointments for a week and repeat it for 4 weeks. on android it creates for 3 sequential days but on uwp it will create for same day.

Thanks,

Emil  

Attachment: RecurrenceAppoointment_Sample_d3a3bace.7z


SP Subburaj Pandian Veluchamy Syncfusion Team January 30, 2017 10:04 AM UTC

Hi Emil, 
 
Thank you for the update. 
 
We have created a support incident under your account to track the status of this issue. Please log on to our support website to check for further updates. 
 
 
Please let us know, if you have any query.

Regards, 
Subburaj Pandian V.

 


Loader.
Live Chat Icon For mobile
Up arrow icon