From b622a433e92d81c9b4ae6d87a914b0ddd0f305f0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 26 Jul 2012 20:56:33 +0000 Subject: [PATCH] Monotone-Parent: 3c0814786842608f4b2aea659b16c3eb7e694f9d Monotone-Revision: bc3ed474ad46d79c92b1456be764f4803b264d92 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-07-26T20:56:33 Monotone-Branch: ca.inverse.sogo --- SOPE/NGCards/ChangeLog | 9 +++++++++ SOPE/NGCards/iCalTimeZonePeriod.h | 9 +++++++++ SOPE/NGCards/iCalTimeZonePeriod.m | 10 ++++++++++ 3 files changed, 28 insertions(+) diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 00e9c352b..c3d36d07a 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,12 @@ +2012-07-26 Wolfgang Sourdeau + + * iCalTimeZonePeriod.m (-recurrenceRule): new accessor for the + "rrule" element. + (-startDate): made method public. + (-compare:): new method that compare two periods based on their + startDate, for timezone definitions which have a "standard" or + "daylight" period for more that one years. + 2012-05-30 Francis Lachapelle * iCalRepeatableEntityObject.m (-exceptionDatesWithTimeZone:) diff --git a/SOPE/NGCards/iCalTimeZonePeriod.h b/SOPE/NGCards/iCalTimeZonePeriod.h index a710630df..838176804 100644 --- a/SOPE/NGCards/iCalTimeZonePeriod.h +++ b/SOPE/NGCards/iCalTimeZonePeriod.h @@ -25,11 +25,20 @@ #import "CardGroup.h" +@class NSCalendarDate; + +@class iCalRecurrenceRule; + @interface iCalTimeZonePeriod : CardGroup +- (NSCalendarDate *) startDate; +- (iCalRecurrenceRule *) recurrenceRule; + - (NSCalendarDate *) occurenceForDate: (NSCalendarDate *) refDate; - (int) secondsOffsetFromGMT; +- (NSComparisonResult) compare: (iCalTimeZonePeriod *) otherPeriod; + @end #endif /* ICALTIMEZONEPERIOD_H */ diff --git a/SOPE/NGCards/iCalTimeZonePeriod.m b/SOPE/NGCards/iCalTimeZonePeriod.m index b161f55ab..f3613ee68 100644 --- a/SOPE/NGCards/iCalTimeZonePeriod.m +++ b/SOPE/NGCards/iCalTimeZonePeriod.m @@ -109,6 +109,11 @@ dateTime]; } +- (iCalRecurrenceRule *) recurrenceRule +{ + return (iCalRecurrenceRule *) [self firstChildWithTag: @"rrule"]; +} + /** * This method returns the date corresponding for to the start of the period * in the year of the reference date. @@ -184,4 +189,9 @@ return [self _secondsOfOffset: @"tzoffsetto"]; } +- (NSComparisonResult) compare: (iCalTimeZonePeriod *) otherPeriod +{ + return [[self startDate] compare: [otherPeriod startDate]]; +} + @end