Free Support Forum - aspose.com

Bug into the iCalculator component

Hi,



I want to report a bug into the component Aspose.Network.iCalendar.


When calling the RecurrencePattern.GenerateOccurrences with the parameters rangeStart and rangeEnd, the component returns values outside the range that I’ve specified.
It looks like a bug unless the designers had a different meaning for the parameters rangeStart and rangeEnd.

As you can see from the attached picture, I am calling this method with the parameters:

- computedPeriodStart {06.07.2011 18:35:30}

- computedPeriodEnd {06.07.2013 18:35:29}

but it returns an occurrence outside (in front) of my range with one second: {06.07.2011 18:35:29}


The documentation is quite vague so I might be wrong understanding the purpose of those parameters:



Thanks for your support,

Florin Iliuta


The documentation for the method looks like this:

RecurrencePattern.GenerateOccurrences Method (DateTime, DateTime)

Generates the occurrences.

public DateCollection GenerateOccurrences(
DateTime rangeStart,
DateTime rangeEnd
);

Parameters

rangeStart
The range start.

rangeEnd
The range end.

Return Value


Hi,

Thank you for inquiry.

Could you please set the RecurrenceRule.Until to set the end date/time? If you still have issues, please post the sample code to generate the recurrence pattern.

I used the below code to generate a pattern:


RecurrencePattern recPattern = new RecurrencePattern();
DateTime startDate = DateTime.Now;
recPattern.StartDate = startDate;
//recPattern.EndDate = DateTime.Now.AddDays(5);
RecurrenceRule rule = recPattern.RRules.Add();
rule.Frequency = Frequency.Daily;
rule.Until = DateTime.Now.AddDays(5);
DateCollection dtColl = recPattern.GenerateOccurrences();