Free Support Forum - aspose.com

RecurrencePattern Issues

We are having difficulties using RecurrencePattern class in our .net 3.5 projects. If we set the pattern like the following
DTSTART:19110507T010000Z
RRULE:FREQ=MINUTELY;INTERVAL=120

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
DTSTART:20110507T010000Z
RRULE:FREQ=MINUTELY;INTERVAL=120
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 = datetime.now 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.

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

Hi,

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
RRULE:FREQ=MINUTELY;INTERVAL=120”;
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.