merge of '1e037a870db694332f09d5b9487b81d3c76ade7a'
and '7285cdd10c4ae24e612e984c6b14a96e15e060a1' Monotone-Parent: 1e037a870db694332f09d5b9487b81d3c76ade7a Monotone-Parent: 7285cdd10c4ae24e612e984c6b14a96e15e060a1 Monotone-Revision: f98cf98b9e244d049aff84921d88c0db705241f1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-28T17:54:14 Monotone-Branch: ca.inverse.sogomaint-2.0.2
commit
14221a130c
|
@ -1,3 +1,16 @@
|
|||
2010-09-28 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* NSString+NGCards.m (-asCalendarDate): added handling of date that
|
||||
includes dashes (YYYY-MM-DD).
|
||||
|
||||
* iCalDateTime.m (-dateTimes): new method that handles EXDATE with
|
||||
multiple values.
|
||||
|
||||
* iCalRepeatableEntityObject.m (-exceptionDates): add all values
|
||||
from each EXDATE attribute.
|
||||
|
||||
* iCalRepeatableEntityObject.m (-exceptionDates): idem.
|
||||
|
||||
2010-08-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalPerson.m, iCalWeeklyRecurrenceCalculator.m: adapted classes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* NSString+NGCards.m - this file is part of SOPE
|
||||
*
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
* Copyright (C) 2006-2010 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -246,8 +246,12 @@ static NSString *commaSeparator = nil;
|
|||
year = [[self substringWithRange: cursor] intValue];
|
||||
cursor.location += cursor.length;
|
||||
cursor.length = 2;
|
||||
if ([[self substringWithRange: cursor] hasPrefix: @"-"])
|
||||
cursor.location += 1;
|
||||
month = [[self substringWithRange: cursor] intValue];
|
||||
cursor.location += cursor.length;
|
||||
if ([[self substringWithRange: cursor] hasPrefix: @"-"])
|
||||
cursor.location += 1;
|
||||
day = [[self substringWithRange: cursor] intValue];
|
||||
|
||||
if (length > 14)
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
- (void) setDate: (NSCalendarDate *) date;
|
||||
- (void) setDateTime: (NSCalendarDate *) dateTime;
|
||||
|
||||
- (NSArray *) dateTimes;
|
||||
- (NSCalendarDate *) dateTime;
|
||||
|
||||
- (BOOL) isAllDay;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
|
||||
|
@ -150,37 +151,51 @@
|
|||
}
|
||||
|
||||
- (NSCalendarDate *) dateTime
|
||||
{
|
||||
return [[self dateTimes] lastObject];
|
||||
}
|
||||
|
||||
- (NSArray *) dateTimes
|
||||
{
|
||||
iCalTimeZone *iTZ;
|
||||
NSString *date;
|
||||
NSCalendarDate *initialDate, *dateTime;
|
||||
NSMutableArray *dates;
|
||||
NSTimeZone *tz;
|
||||
unsigned count, i;
|
||||
|
||||
date = [self value: 0];
|
||||
iTZ = [self timeZone];
|
||||
if (iTZ)
|
||||
dateTime = [iTZ dateForDateTimeString: date];
|
||||
else
|
||||
count = [[self values] count];
|
||||
dates = [NSMutableArray arrayWithCapacity: count];
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
initialDate = [date asCalendarDate];
|
||||
if (initialDate)
|
||||
{
|
||||
if ([date hasSuffix: @"Z"] || [date hasSuffix: @"z"])
|
||||
dateTime = initialDate;
|
||||
else
|
||||
{
|
||||
/* same TODO as above */
|
||||
tz = [NSTimeZone defaultTimeZone];
|
||||
dateTime = [initialDate addYear: 0 month: 0 day: 0
|
||||
hour: 0 minute: 0
|
||||
second: -[tz secondsFromGMTForDate: initialDate]];
|
||||
}
|
||||
}
|
||||
date = [self value: i];
|
||||
iTZ = [self timeZone];
|
||||
if (iTZ)
|
||||
dateTime = [iTZ dateForDateTimeString: date];
|
||||
else
|
||||
dateTime = nil;
|
||||
{
|
||||
initialDate = [date asCalendarDate];
|
||||
if (initialDate)
|
||||
{
|
||||
if ([date hasSuffix: @"Z"] || [date hasSuffix: @"z"])
|
||||
dateTime = initialDate;
|
||||
else
|
||||
{
|
||||
/* same TODO as above */
|
||||
tz = [NSTimeZone defaultTimeZone];
|
||||
dateTime = [initialDate addYear: 0 month: 0 day: 0
|
||||
hour: 0 minute: 0
|
||||
second: -[tz secondsFromGMTForDate: initialDate]];
|
||||
}
|
||||
}
|
||||
else
|
||||
dateTime = nil;
|
||||
}
|
||||
if (dateTime)
|
||||
[dates addObject: dateTime];
|
||||
}
|
||||
|
||||
return dateTime;
|
||||
|
||||
return dates;
|
||||
}
|
||||
|
||||
- (BOOL) isAllDay
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
Copyright (C) 2010 Inverse inc.
|
||||
|
||||
This file is part of SOPE.
|
||||
|
||||
|
@ -131,18 +132,26 @@
|
|||
|
||||
- (NSArray *) exceptionDates
|
||||
{
|
||||
NSArray *exDates;
|
||||
NSMutableArray *dates;
|
||||
NSEnumerator *dateList;
|
||||
NSCalendarDate *exDate;
|
||||
NSString *dateString;
|
||||
unsigned i;
|
||||
|
||||
dates = [NSMutableArray array];
|
||||
dateList = [[self childrenWithTag: @"exdate"] objectEnumerator];
|
||||
while ((exDate = [[dateList nextObject] dateTime]))
|
||||
|
||||
while ((dateString = [dateList nextObject]))
|
||||
{
|
||||
dateString = [NSString stringWithFormat: @"%@Z",
|
||||
[exDate iCalFormattedDateTimeString]];
|
||||
[dates addObject: dateString];
|
||||
exDates = [(iCalDateTime*) dateString dateTimes];
|
||||
for (i = 0; i < [exDates count]; i++)
|
||||
{
|
||||
exDate = [exDates objectAtIndex: i];
|
||||
dateString = [NSString stringWithFormat: @"%@Z",
|
||||
[exDate iCalFormattedDateTimeString]];
|
||||
[dates addObject: dateString];
|
||||
}
|
||||
}
|
||||
|
||||
return dates;
|
||||
|
|
Loading…
Reference in New Issue