Free Support Forum -

RecurrencePattern Issues

We are having difficulties using RecurrencePattern class in our .net 3.5 projects. If we set the pattern like the following

Code Example: DateCollection occurences = recurrencePattern.GenerateOccurrences(start, end);

In our code uses the start date and end date from now on to get next 5 occurances it unresponsive for long time.. actually seems forever.
if we change the date in like
it returns immidiately.

We tried to set the RecurrencePattern.StartDate = Datetime.Now but it dosn't work and executes the code indefintely.
Can someone provide an solution with example in .net how we can override the start date other than DTSDATE.

We are currently setting startdate = and enddate is added based on the minutes interval we pass in the pattern for next 5 times.

What we want is the RecurrencePattern should loop from now and number of times in future we decide so that it uses less CPU to calculate the pattern.

The Aspose DLL file version is which a licensed version bought for the company Factonomy Ltd.


Thank you for inquiry.

The RecurrencePattern.StartDate overrides DTSTART value. I tried the below code at my end and it returned the results immediately:

string strPattern = @“DTSTART:19110507T010000Z
RecurrencePattern pattern = new RecurrencePattern(strPattern);
Console.WriteLine("Start Date before: " + pattern.StartDate);
// set start date as today
pattern.StartDate = DateTime.Now;
Console.WriteLine("Start Date after: " + pattern.StartDate);
// generate the recurrence dates
DateCollection dates = pattern.GenerateOccurrences(DateTime.Today, DateTime.Today.AddDays(1));

Please try this at your end and check if it fulfills your requirements and works.