diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 3ddc72939..5e6348e4f 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2007-12-12 Wolfgang Sourdeau + + * iCalTimeZone.m ([iCalTimeZone -periodForDate:date]): at least + one timezone period is needed so we might need to fallback on the + only one present if the other does not exist. + 2007-11-29 Wolfgang Sourdeau * iCalDateTime.m ([iCalDateTime -timeZone]): log a message if the diff --git a/SOPE/NGCards/iCalTimeZone.m b/SOPE/NGCards/iCalTimeZone.m index 0e2e56be4..cd7afbe97 100644 --- a/SOPE/NGCards/iCalTimeZone.m +++ b/SOPE/NGCards/iCalTimeZone.m @@ -89,13 +89,18 @@ forDate: date]; standardOccurence = [self _occurenceForPeriodNamed: @"standard" forDate: date]; - if ([date earlierDate: daylightOccurence] == date - || [date earlierDate: standardOccurence] == standardOccurence) + + if (!standardOccurence) + period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"]; + else if (!daylightOccurence) + period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"]; + else if ([date earlierDate: daylightOccurence] == date + || [date earlierDate: standardOccurence] == standardOccurence) period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"]; else period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"]; - NSLog (@"chosen period: '%@'", [period tag]); +// NSLog (@"chosen period: '%@'", [period tag]); return period; }