]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1387 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 10 Mar 2008 05:02:26 +0000 (05:02 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 10 Mar 2008 05:02:26 +0000 (05:02 +0000)
SOPE/NGCards/ChangeLog
SOPE/NGCards/iCalRecurrenceRule.h
SOPE/NGCards/iCalRecurrenceRule.m
SOPE/NGCards/iCalTimeZonePeriod.m

index a3644f072ba794d295194c09226306e4820cd456..7abe74abe60431628c769e157ea528402b141cfe 100644 (file)
@@ -1,3 +1,14 @@
+2008-03-10  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * iCalTimeZonePeriod.m ([iCalTimeZonePeriod
+       -dayOfWeekFromRruleDay:day]): the algorithm would never work if
+       the day was monday. After it was changed for sunday (see below),
+       it would return 1 instead of 0.
+
+       * iCalRecurrenceRule.m ([iCalRecurrenceRule -setByDayMask:_mask]):
+       the first day of the week is always sunday, following Apple's
+       documentation.
+
 2008-03-03  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * NGVCardReference.[hm]: new class module that implements the base
index 478f507f8154a36c093318f5da98b2ff6b495d81..54542229bfa148b800c4af4a875109d283e25ee5 100644 (file)
@@ -46,13 +46,13 @@ typedef enum {
 } iCalRecurrenceFrequency;
 
 typedef enum {
-  iCalWeekDayMonday    = 1,
-  iCalWeekDayTuesday   = 2,
-  iCalWeekDayWednesday = 4,
-  iCalWeekDayThursday  = 8,
-  iCalWeekDayFriday    = 16,
-  iCalWeekDaySaturday  = 32,
-  iCalWeekDaySunday    = 64,
+  iCalWeekDaySunday    = 1,
+  iCalWeekDayMonday    = 2,
+  iCalWeekDayTuesday   = 4,
+  iCalWeekDayWednesday = 8,
+  iCalWeekDayThursday  = 16,
+  iCalWeekDayFriday    = 32,
+  iCalWeekDaySaturday  = 64,
 } iCalWeekDay;
 
 @class NSString, NSCalendarDate, NGCalendarDateRange, NSArray;
index f53f7988f43f9f4b0447fb1e657000365e051180..3ce38f1a68f00b01820656e2ee1527cabc3bf4e6 100644 (file)
 {
   NSMutableArray *days;
   unsigned int count;
-  unsigned char maskDays[] = { iCalWeekDayMonday, iCalWeekDayTuesday,
-                               iCalWeekDayWednesday, iCalWeekDayThursday,
-                               iCalWeekDayFriday, iCalWeekDaySaturday,
-                               iCalWeekDaySunday };
+  unsigned char maskDays[] = { iCalWeekDaySunday, iCalWeekDayMonday,
+                              iCalWeekDayTuesday, iCalWeekDayWednesday,
+                              iCalWeekDayThursday, iCalWeekDayFriday,
+                              iCalWeekDaySaturday };
   days = [NSMutableArray arrayWithCapacity: 7];
   if (_mask)
     {
index dc1f611fddf59508c5c95cbaef9135c34d2a1eaa..b5380f11eeaadd7a8913f94523d93163079210b2 100644 (file)
@@ -92,8 +92,8 @@
 {
   unsigned int dayOfWeek;
 
-  dayOfWeek = 1;
-  while (day >> dayOfWeek)
+  dayOfWeek = 0;
+  while (day >> (dayOfWeek + 1))
     dayOfWeek++;
 
   return dayOfWeek;
                     day: 0 hour: 0 minute: 0
                     second: -[self _secondsOfOffset: @"tzoffsetfrom"]];
   dateDayOfWeek = [tmpDate dayOfWeek];
-  offset = (dayOfWeek - dateDayOfWeek);
-  if (pos > 0 && offset < 0)
-    offset += 7;
-  offset += (pos * 7);
+// #warning FIXME
+  offset = (dayOfWeek - dateDayOfWeek) + ((pos -1 ) * 7);
   tmpDate = [tmpDate addYear: 0 month: 0 day: offset
                     hour: 0 minute: 0 second: 0];