Using the online demo, I am trying to return the 1st Wednesday of May every 2 years between 1/1/2001 and 1/1/2004. When entering this through the demo interface, the following pattern is developed:
DTSTART:20010101T103000
RRULE:FREQ=MONTHLY;UNTIL=20040101T000000Z;INTERVAL=24;BYMONTH=5;BYDAY=1WE
This only generates one date, the start date. I understand the issue with why 1/1/2001 is returned (because its the start date), but why are no other dates generated?
I'm trying to get these dates via C# code using:
RecurrencePattern pattern = new RecurrencePattern();
pattern.StartDate = Convert.ToDateTime("01/01/2001");
RecurrenceRule rule = pattern.RRules.Add();
rule.EndType = EndType.Until;
rule.Until = Convert.ToDateTime("01/01/2004");
rule.Frequency = Frequency.Monthly;
rule.Interval = 24;
rule.ByMonth.Add(5);
rule.ByDay.Add(1, DayOfWeek.Wednesday);
DateCollection dates = pattern.GenerateOccurrences();
What am I doing wrong? Thanks.
SJL