diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index b74626387..a6663c5df 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,5 +1,10 @@ 2010-03-09 Wolfgang Sourdeau + * iCalTimeZone.m (-periodForDate:): the order in which daylight + and standard occur is not the same in the northern and southern + hemisphere. We were thus choosing the wrong period for southern + areas. + * iCalTimeZonePeriod.m (_occurenceForDate:byRRule:): fixed computing of timezone switch dates, which were offset by one week too early. diff --git a/SOPE/NGCards/iCalTimeZone.m b/SOPE/NGCards/iCalTimeZone.m index be82b997c..9de729ff5 100644 --- a/SOPE/NGCards/iCalTimeZone.m +++ b/SOPE/NGCards/iCalTimeZone.m @@ -166,13 +166,26 @@ static NSMutableDictionary *cache; 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 if ([date earlierDate: daylightOccurence] == date) + { + if ([date earlierDate: standardOccurence] == date + && ([standardOccurence earlierDate: daylightOccurence] + == standardOccurence)) + period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"]; + else + period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"]; + } else - period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"]; + { + if ([standardOccurence earlierDate: date] == standardOccurence + && ([daylightOccurence earlierDate: standardOccurence] + == daylightOccurence)) + period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"]; + else + period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"]; + } -// NSLog (@"chosen period: '%@'", [period tag]); + // NSLog (@"chosen period: '%@'", [period tag]); return period; }