]> err.no Git - scalable-opengroupware.org/blobdiff - SOGo/UI/SOGoUI/UIxComponent.m
more code for day overview and the usual fixes
[scalable-opengroupware.org] / SOGo / UI / SOGoUI / UIxComponent.m
index 9ccbe480b16212c09172e9be9490fb37f783089d..8786220b830579d9e4589f41b9d97df9c681b70a 100644 (file)
@@ -221,12 +221,23 @@ static NSMutableArray *abbrMonthLabelKeys = nil;
 - (NSCalendarDate *)selectedDate {
   NSString       *s;
   NSCalendarDate *cdate;
-  
+
   s = [self queryParameterForKey:@"day"];
   cdate = ([s length] > 0)
     ? [self dateForDateString:s]
     : [NSCalendarDate date];
   [cdate setTimeZone:[self viewTimeZone]];
+  s = [self queryParameterForKey:@"hm"];
+  if([s length] == 4) {
+      unsigned hour, minute;
+      
+      hour = [[s substringToIndex:2] unsignedIntValue];
+      minute = [[s substringFromIndex:2] unsignedIntValue];
+      cdate = [cdate hour:hour minute:minute];
+  }
+  else {
+      cdate = [cdate hour:12 minute:0];
+  }
   return cdate;
 }
 
@@ -236,14 +247,8 @@ static NSMutableArray *abbrMonthLabelKeys = nil;
 }
 
 - (NSCalendarDate *)dateForDateString:(NSString *)_dateString {
-  NSTimeZone *tz;
-  
-  tz = [self viewTimeZone];
-  /* Note: we should give a time, best is noon to avoid edge conditions */
-  _dateString = [_dateString stringByAppendingFormat:@"12:00:00 %@",
-                              [tz abbreviation]];
   return [NSCalendarDate dateWithString:_dateString 
-                        calendarFormat:@"%Y%m%d %H:%M:%S %Z"];
+                        calendarFormat:@"%Y%m%d"];
 }