Simple Weekly recurrence without BYDAY

Hello,

I am trying to create a simple Weekly recurrence on my appointment.

I tried with 'FREQ=WEEKLY; INTERVAL=1;COUNT=10' hoping that this would be enough to make the appointment recur every week on the same weekday and time, but it seems not enough. I can not see the recurrence in the scheduler. 

Adding a BYDAY definition for the same day as the start date of the appointment makes the recurrence appear in the scheduler but this creates 2 other problems:
  1. Fixing the weekday is problematic when working in different timezones (Start Date in one timezone could have a different weekday in another timezone)
  2. Changing the startdate of the appointment doesn't automatically update the BYDAY rule.
So, what is the solution without adding a BYDAY rule definition? What am I missing?

Thanks,
Bernard

3 Replies

GC Ganeshamoorthy Chandramoorthy Syncfusion Team May 24, 2018 12:59 PM UTC

Hi Bernard, 
 
We have checked with the provided information. For weekly recurrence appointment, it is mandatory to set the BYDAY value in the recurrence rule in our schedule.  
 
Regarding different timezone issue, it can be handled in the sample by setting the BYDAY value based on the device time zone and you can update it dynamically once the device time zone is changed.  
 
Regarding “Changing the start date of the appointment doesn't automatically update the BYDAY rule” query it can also be handled in the sample by updating the recurrence rule along with the start date and end date in run time. Kindly find the code snippet below, 
 
Code snippet: 
            //Intially setting the recurrence rule, start date and end date to the appointment 
            RecurrenceProperties recurrenceProperties = new RecurrenceProperties(); 
            recurrenceProperties.RecurrenceType = RecurrenceType.Weekly; 
            recurrenceProperties.WeeklyEveryNWeeks = 1; 
            recurrenceProperties.IsWeeklyThursday = true; 
            recurrenceProperties.IsRangeRecurrenceCount = true; 
            recurrenceProperties.RangeRecurrenceCount = 10; 
            recurrenceProperties.RecurrenceRule = DependencyService.Get<IRecurrenceBuilder>().RRuleGenerator(recurrenceProperties, meeting.StartTime, meeting.EndTime); 
            appointment.RecurrenceRule = recurrenceProperties.RecurrenceRule; 
 
            appointment.StartTime = new DateTime(2018, 05, 24, 10, 0, 0); 
            appointment.EndTime = meeting.StartTime.AddHours(2); 
 
 
 
        //Dynamically changing the recurrence rule, start date and end date to the appointment 
        void Button_Clicked(object sender, EventArgs e) 
        { 
            RecurrenceProperties recurrenceProperties = new RecurrenceProperties(); 
            recurrenceProperties.RecurrenceType = RecurrenceType.Weekly; 
            recurrenceProperties.WeeklyEveryNWeeks = 1; 
            recurrenceProperties.IsWeeklyMonday = true; 
            recurrenceProperties.IsRangeRecurrenceCount = true; 
            recurrenceProperties.RangeRecurrenceCount = 10; 
            recurrenceProperties.RecurrenceRule = DependencyService.Get<IRecurrenceBuilder>().RRuleGenerator(recurrenceProperties, meeting.StartTime, meeting.EndTime); 
            appointment.RecurrenceRule = recurrenceProperties.RecurrenceRule; 
 
            appointment.StartTime = new DateTime(2018, 05, 22, 10, 0, 0); 
            appointment.EndTime = meeting.StartTime.AddHours(2); 
        } 
 
 
Here, you need to set BYDAY value, by converting your appointment time zone based on system/device time zone and get its day value. 
 
Regards, 
Ganeshamoorthy C 



BE Bernard June 7, 2018 08:50 AM UTC

Hey there,



Thanks for your answer and I understand I need to always set the BYDAY.


As for the Timezone issue, let me see if I can resume this:


Assuming that I store the RecurrenceRule, StartTime and EndTime in my DB  and assuming that my stored rule is 'FREQ=WEEKLY; INTERVAL=1;BYDAY=MO,WE;COUNT=10' then to show the appointment correctly for a certain Timezone I should:


1. Get the ByDay value (MO, WE) from my rule

2. Determine if the appoint StartTime occurs on a different day in my devices timeZone (either +1 day or -1 day)

3. Change the BYDAY rule according to point 2. (ex if I find my time zone is 12h behind and on the day before then BYDAY becomes 'SU,TU')


So the rule I need to generate now is FREQ=WEEKLY; INTERVAL=1;BYDAY=SU,TU;COUNT=10'


Would you say that is correct?

Let me see if I can test this and I will let you know.


Thanks,

Bernard




GC Ganeshamoorthy Chandramoorthy Syncfusion Team June 8, 2018 02:15 PM UTC

Hi Bernard, 
 
As mentioned in our previous update, it is not possible to dynamically handle BYDAY in recurrence rule based on time zone in our SfSchedule. So, we suggested the approach in sample level as you described with example. Please let us know if you require further assistance on this. 
 
Regards, 
Ganeshamoorthy C 


Loader.
Up arrow icon