Improve debugging output of recurrence calculator

This commit is contained in:
Francis Lachapelle
2017-01-10 10:17:16 -05:00
parent bce09f413f
commit c36fcd2902
3 changed files with 27 additions and 1 deletions

View File

@@ -61,6 +61,8 @@
long i, count, repeatCount;
unsigned interval;
//[self logWithFormat: @"Recurrence rule is %@", rrule];
firStart = [firstRange startDate];
startDate = [_r startDate];
endDate = [_r endDate];

View File

@@ -921,4 +921,28 @@ NSString *iCalWeekDayString[] = { @"SU", @"MO", @"TU", @"WE", @"TH", @"FR",
return isEqual;
}
- (NSString *) description
{
NSMutableString *str;
str = [NSMutableString stringWithString: [self flattenedValuesForKey: @"freq"]];
if ([self repeatInterval] > 1)
[str appendFormat: @" interval of %i", [self repeatInterval]];
if ([self repeatCount])
[str appendFormat: @" for %i times", [self repeatCount]];
if ([self untilDate])
[str appendFormat: @" until %@", [self untilDate]];
if ([[self valuesAtIndex: 0 forKey: @"bymonthday"] count])
[str appendFormat: @" BYMONTHDAY:%@", [self flattenedValuesForKey: @"bymonthday"]];
if ([[self valuesAtIndex: 0 forKey: @"byday"] count])
[str appendFormat: @" BYDAY:%@", [self flattenedValuesForKey: @"byday"]];
if ([[self valuesAtIndex: 0 forKey: @"bymonth"] count])
[str appendFormat: @" BYMONTH:%@", [self flattenedValuesForKey: @"bymonth"]];
if ([[self valuesAtIndex: 0 forKey: @"bysetpos"] count])
[str appendFormat: @" BYSETPOS:%@", [self flattenedValuesForKey: @"bysetpos"]];
return str;
}
@end /* iCalRecurrenceRule */

View File

@@ -70,7 +70,7 @@
iCalByDayMask *dayMask;
BOOL hasRepeatCount;
[self logWithFormat: @"Weekly %@", rrule];
//[self logWithFormat: @"Recurrence rule is %@", rrule];
firStart = [firstRange startDate];
startDate = [_r startDate];