From 1008505fb520d191232ba887d4f5af9c9b0b24c9 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 20 Oct 2009 18:22:53 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: a7388b1eb7856d57df84b1de0be0ed020317178c Monotone-Revision: 1cdbd08ce823952005537aad8577c0f54c23c532 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-10-20T18:22:53 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++++- SOPE/NGCards/iCalDateTime.h | 2 +- SOPE/NGCards/iCalTimeZonePeriod.m | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31e3737cf..3ce4db100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,11 @@ -davCreateCollection:inContext: We check, prior to creating the resource, if where we create it is a supported target. - + * SOPE/NGCards/iCalTimeZonePeriod.m + -_occurenceForDate:byRRule: + We correctly compute the number of shifting days + during DST changes. + 2009-10-19 Francis Lachapelle * SoObjects/SOGo/NSCalendarDate+SOGo.m: lower the values of diff --git a/SOPE/NGCards/iCalDateTime.h b/SOPE/NGCards/iCalDateTime.h index 84d4e9b45..47e4ca0b7 100644 --- a/SOPE/NGCards/iCalDateTime.h +++ b/SOPE/NGCards/iCalDateTime.h @@ -1,6 +1,6 @@ /* iCalDateTime.h - this file is part of SOGo * - * Copyright (C) 2006 Inverse inc. + * Copyright (C) 2006-2009 Inverse inc. * * Author: Wolfgang Sourdeau * diff --git a/SOPE/NGCards/iCalTimeZonePeriod.m b/SOPE/NGCards/iCalTimeZonePeriod.m index fb5686da4..2fc180ca7 100644 --- a/SOPE/NGCards/iCalTimeZonePeriod.m +++ b/SOPE/NGCards/iCalTimeZonePeriod.m @@ -110,6 +110,7 @@ dayOfWeek = [self dayOfWeekFromRruleDay: [rrule byDayMask]]; pos = [[byDay substringToIndex: 2] intValue]; if (!pos) + /* if byday = "SU", instead of "1SU"... */ pos = 1; tmpDate = [NSCalendarDate dateWithYear: [refDate yearOfCommonEra] @@ -119,9 +120,14 @@ tmpDate = [tmpDate addYear: 0 month: ((pos > 0) ? 0 : 1) day: 0 hour: 0 minute: 0 second: -[self _secondsOfOffset: @"tzoffsetfrom"]]; + dateDayOfWeek = [tmpDate dayOfWeek]; -// #warning FIXME - offset = (dayOfWeek - dateDayOfWeek) + ((pos -1 ) * 7); + + if (pos > 0) + offset = (dayOfWeek - dateDayOfWeek) + ((pos - 1) * 7); + else + offset = (dateDayOfWeek - dayOfWeek) + (pos * 7); + tmpDate = [tmpDate addYear: 0 month: 0 day: offset hour: 0 minute: 0 second: 0];