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;
}