See ChangeLogs.

Monotone-Parent: 8d68561f51adcd8910568babcba5d38587755f06
Monotone-Revision: 18a37cc2e34898697d26aa8ab49aaab61673a465

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-04-22T13:15:04
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2010-04-22 13:15:04 +00:00
parent 7c4a7d491f
commit ed80559b05
5 changed files with 42 additions and 14 deletions

View File

@ -1,3 +1,9 @@
2010-04-22 Francis Lachapelle <flachapelle@inverse.ca>
* Tests/Unit/TestiCalRecurrenceCalculator.m: new test module for
iCalRecurrenceRule. Added full test method for
recurrenceRangesWithinCalendarDateRange:.
2010-04-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Main/SOGo+DAV.m: commented out incomplete code for handling

View File

@ -1,3 +1,15 @@
2010-04-22 Francis Lachapelle <flachapelle@inverse.ca>
* iCalYearlyRecurrenceCalculator.m
(-recurrenceRangesWithinCalendarDateRange:): the rule interval
must be reset to 1 when using the monthly calculator since the
interval is related to the yearly frequency. Also fixed the month
counter with respect to the recurrence interval.
* iCalWeeklyRecurrenceCalculator.m
(-recurrenceRangesWithinCalendarDateRange:): fixed the computation
of the week number which results in a bad verification of the interval.
2010-04-19 Francis Lachapelle <flachapelle@inverse.ca>
* iCalByDayMask.[h|m]: new class that computes complex BYDAY constraints.

View File

@ -168,8 +168,11 @@
{
[currentStartDate years:NULL months:NULL days:(int *)&days hours:NULL
minutes:NULL seconds:NULL sinceDate: firStart];
week = days / 7;
// The following adjustment always set the first day of the
// week to Sunday, ie WKST is ignored.
week = (days + [firStart dayOfWeek]) / 7;
if ((week % interval) == 0 &&
[dayMask occursOnDay: [currentStartDate dayOfWeek]])
isRecurrence = YES;

View File

@ -120,12 +120,12 @@
*/
// Instantiate a MONTHLY calculator
if (repeatCount > 0)
// Fool the monthly calculator, otherwise it will verify the COUNT
// constraint and perform the calculation from the first occurence of
// the recurrence. This calculation is performed by the current method.
[rrule setRepeatCount: 0];
// Fool the monthly calculator, otherwise it will verify the COUNT
// constraint and perform the calculation from the first occurence of
// the recurrence. This calculation is performed by the current method.
// The interval must be ignored as well since it refers to the years.
[rrule setRepeatCount: 0];
[rrule setInterval: @"1"];
monthlyCalc = [[iCalMonthlyRecurrenceCalculator alloc]
initWithRecurrenceRule: rrule
firstInstanceCalendarDateRange: firstRange];
@ -161,7 +161,7 @@
currentMonth = [referenceDate monthOfYear];
for (yearIdxInRange = 0 ; yearIdxInRange < numberOfYearsInRange; yearIdxInRange++)
{
int test, year;
int k, test, year;
test = diff + yearIdxInRange;
if ((test >= 0) && (test % interval) == 0)
@ -184,12 +184,11 @@
days: 0];
rEnd = [rStart dateByAddingYears: 0
months: 0
days: [rStart numberOfDaysInMonth] - 1];
days: [rStart numberOfDaysInMonth]];
rangeForMonth = [NGCalendarDateRange calendarDateRangeWithStartDate: rStart
endDate: rEnd];
rangesInMonth = [monthlyCalc recurrenceRangesWithinCalendarDateRange: rangeForMonth];
int k;
for (k = 0; k < [rangesInMonth count] && (repeatCount == 0 || count < repeatCount); k++) {
//NSLog(@"*** YEARLY found %@ (count = %i)", [[rangesInMonth objectAtIndex: k] startDate], count);
count++;
@ -224,12 +223,19 @@
}
}
}
else
{
// Year was skipped, added 12 months to the counter
monthDiff += 12;
}
}
if (byMonth && repeatCount > 0)
// Restore the repeat count
[rrule setRepeatCount: repeatCount];
if (byMonth)
{
// Restore the repeat count and interval
[rrule setRepeatCount: repeatCount];
[rrule setRepeatInterval: interval];
}
return ranges;
}

View File

@ -15,6 +15,7 @@ $(TEST_TOOL)_OBJC_FILES += \
SOGoTestRunner.m \
\
TestiCalTimeZonePeriod.m \
TestiCalRecurrenceCalculator.m \
\
TestBSJSONAdditions.m