Aspose.Recurrence 1.1.3 and earlier versions.
When using Weekly recurrence it is possible to specify a combination of days of week and recurrence start date that will result in wrong occurrence dates calculated.
public void TestSundayBug()
Weekly recur = new Weekly(1);
//This combination of start date and days if week will result in incorrect dates.
recur.StartDate = new DateTime(2003, 12, 15);
recur.MaxOccurrences = 10;
DateArray dates = new DateArray();
recur.GenerateOccurrences(recur.StartDate, DateTime.MaxValue, dates);
//At the moment it generates 12/15, 12/22, 12/22, 12/29, 12/29.
//Below are correct dates that should be returned by the component.
Assertion.AssertEquals(new DateTime(2003, 12, 15), dates);
Assertion.AssertEquals(new DateTime(2003, 12, 21), dates);
Assertion.AssertEquals(new DateTime(2003, 12, 22), dates);
Assertion.AssertEquals(new DateTime(2003, 12, 28), dates);
Assertion.AssertEquals(new DateTime(2003, 12, 29), dates);
Change start date of the recurrence pattern. In the above example if start date was changed to 2003/12/14 for example, the problem would disappear.
We are working on this issue at the moment and will post when it is resolved.
Note that occurrence dates for a weekly pattern can be calculated out of the chronological order due to the way Weekly class works internally. This is easy to workaround, you can just sort the DateArray if you need to. We will address this in the fix too and always return chronologically sorted dates.
This issue has been fixed in Aspose.Recurrence 22.214.171.124.
For more details please see http://www.aspose.com/forums/ShowPost.aspx?PostID=1977#3456.