]> err.no Git - scalable-opengroupware.org/commitdiff
code cleanup and fix for weekOfYear setting
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 24 Jun 2004 11:03:44 +0000 (11:03 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 24 Jun 2004 11:03:44 +0000 (11:03 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@62 d1b88da0-ebda-0310-925b-ed51d893ca5b

ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m
ZideStore/UI-X/Scheduler/UIxCalMonthView.m

index 4d11a3cb2db527f356535820e83ffa81fecff36d..17526f66b10e8bfb28c4641b5f28a20219462ccd 100644 (file)
     NSCalendarDate *date;
     
     self->weekOfYear = _week;
-    date = [[self startDate] mondayOfWeek:self->weekOfYear];
+    if(_week == 52 || _week == 53)
+        date = [[self startDate] mondayOfWeek];
+    else
+        date = [self startDate];
+    date = [date mondayOfWeek:_week];
     [self setCurrentWeekStartDate:date];
 }
 
index 7544aaacc7ff378dc68a166eb306fc849e7dd9e6..fa3a216463626f940a5bf2f2782b5c3db4b578af 100644 (file)
 }
 
 - (NSCalendarDate *)endDate {
-  NSCalendarDate *startDate;
-
-  startDate = [self startDate];
-  return [startDate dateByAddingYears:0 months:0 days:[startDate numberOfDaysInMonth]
-                          hours:0 minutes:0 seconds:0];
+  NSCalendarDate *startDate = [self startDate];
+  return [startDate dateByAddingYears:0
+                    months:0
+                    days:[startDate numberOfDaysInMonth]
+                    hours:0
+                    minutes:0
+                    seconds:0];
 }
 
-/* URLs (TODO: fix scroll ranges for months!) */
+/* URLs */
 
 
 - (NSDictionary *)prevMonthQueryParameters {
     NSCalendarDate *date;
-    
-    date = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
-                                               months:-1
-                                               days:0
-                                               hours:0
-                                               minutes:0
-                                               seconds:0];
+
+    date = [[self startDate] dateByAddingYears:0
+                             months:-1
+                             days:0
+                             hours:0
+                             minutes:0
+                             seconds:0];
     return [self queryParametersBySettingSelectedDate:date];
 }
 
 - (NSDictionary *)nextMonthQueryParameters {
     NSCalendarDate *date;
     
-    date = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
-                                               months:1
-                                               days:0
-                                               hours:0
-                                               minutes:0
-                                               seconds:0];
+    date = [[self startDate] dateByAddingYears:0
+                             months:1
+                             days:0
+                             hours:0
+                             minutes:0
+                             seconds:0];
     return [self queryParametersBySettingSelectedDate:date];
 }