]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1388 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 12 Mar 2008 23:13:45 +0000 (23:13 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 12 Mar 2008 23:13:45 +0000 (23:13 +0000)
ChangeLog
SoObjects/SOGo/NSCalendarDate+SOGo.h
SoObjects/SOGo/NSCalendarDate+SOGo.m
SoObjects/SOGo/SOGoDateFormatter.m
UI/SOGoUI/UIxComponent.m
UI/Scheduler/UIxCalMonthOverview.m
UI/Scheduler/UIxCalMonthViewOld.m

index 3aedecfb7ea96e93fb5e3a505c162d8e07ad795d..b2af91ff5d1701a4f107a0dcb5bca77fc0dc6ed6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-03-10  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * UI/Scheduler/UIxCalMonthViewOld.m ([UIxCalMonthViewOld
+       -endDate]): removed useless method.
+
+       * SoObjects/SOGo/NSCalendarDate+SOGo.m
+       ([-dayOfWeeK:_dayoffsetFromSunday:_offset]): removed useless
+       method.
+       ([-sundayOfWeek]): removed useless method.
+
 2008-03-07  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * OGoContentStore/OCSContactFieldExtractor.m
index 61ad14f1dc69e5baf7b05ba6f958fad2c150624c..de31ca69a527514cfc85648431793e93f8d4cda0 100644 (file)
                     inTimeZone: (NSTimeZone *) timeZone;
 
 - (BOOL) isDateInSameMonth: (NSCalendarDate *) _other;
-- (NSCalendarDate *) dayOfWeeK: (unsigned) _day
-              offsetFromSunday: (unsigned) _off;
-- (NSCalendarDate *) sundayOfWeek;
-- (NSString *) shortDateString;
 
+- (NSString *) shortDateString;
 - (NSString *) rfc822DateString;
 
 + (id) distantFuture;
index 7da917186ee0bc10f534bcbe45f746dbc8e94e13..46ac1f22cfbf71cc9ccf0a52a7799910ab0806d2 100644 (file)
@@ -83,29 +83,6 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
           ([_other monthOfYear] == [self monthOfYear]));
 }
 
-- (NSCalendarDate *) dayOfWeeK: (unsigned) _day 
-              offsetFromSunday: (unsigned) _offset
-{
-  unsigned dayOfWeek, distance;
-    
-  /* perform "locale" correction */
-  dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7;
-
-  _day = (_day % 7);
-  if(_day == dayOfWeek)
-    return self;
-
-  distance = _day - dayOfWeek;
-  return [self dateByAddingYears:0 months:0 days:distance];
-}
-
-/* this implies that monday is the start of week! */
-
-- (NSCalendarDate *) sundayOfWeek
-{
-  return [self dayOfWeeK:6 offsetFromSunday:1];
-}
-
 - (NSString *) shortDateString
 {
   NSString *str;
index 97eb90b565538d3d59d4d5ae2a4578012bdef39f..be1772a95d3116586c06c82a988d8bc5dc1a295b 100644 (file)
   if ((self = [super init]))
     {
       locale = nil;
-//       locale = [_locale retain];
-      
-//       if ([[locale objectForKey:@"NSLocaleCode"] isEqualToString: @"fr"])
-//     shortDateFormat = SOGoDateDMYFormat;
-//       else
-//     shortDateFormat = SOGoDateISOFormat;
       shortDateFormat = nil;
       longDateFormat = nil;
       timeFormat = nil;
   ASSIGN (timeFormat, newFormat);
 }
 
-// - (void) setFullWeekdayNameAndDetails
-// {
-//   auxFormatAction = formatAction;
-//   formatAction = @selector(fullWeekdayNameAndDetailsForDate:);
-// }
-
 /* operation */
 
 - (NSString *) _date: (NSCalendarDate *) date
   return formattedString;
 }
 
-// /* Helpers */
-
-// - (NSString *)shortDayOfWeek:(int)_day {
-//   return [[locale objectForKey:@"NSShortWeekDayNameArray"]
-//        objectAtIndex:_day];
-// }
-
-// - (NSString *)fullDayOfWeek:(int)_day {
-//   return [[locale objectForKey:@"NSWeekDayNameArray"]
-//        objectAtIndex:_day];
-// }
-
-// - (NSString *)shortMonthOfYear:(int)_month {
-//   return [[locale objectForKey:@"NSShortMonthNameArray"]
-//        objectAtIndex:_month - 1];
-// }
-
-// - (NSString *)fullMonthOfYear:(int)_month {
-//   return [[locale objectForKey:@"NSMonthNameArray"]
-//        objectAtIndex:_month - 1];
-// }
-
-
-/* Private API */
-
-// - (NSString *) fullWeekdayNameAndDetailsForDate: (NSCalendarDate *) _date
-// {
-//   NSMutableString *desc;
-
-//   if (_date)
-//     {  
-//       desc = [NSMutableString stringWithCapacity:24];
-//       [desc appendString:[self fullDayOfWeek:[_date dayOfWeek]]];
-//       [desc appendString:@", "];
-//       [desc appendString:[self performSelector:auxFormatAction
-//                            withObject:_date]];
-//       [desc appendString:@" "];
-//       [desc appendFormat:@"%02d:%02d ", [_date hourOfDay], [_date minuteOfHour]];
-//       [desc appendString:[[_date timeZone] abbreviation]];
-//     }
-//   else
-//     desc = nil;
-
-//   return desc;
-// }
-
-// - (NSString *) _separatorForFormat: (unsigned int) format
-// {
-//   NSString *separator;
-
-//   switch (format & (3))
-//     {
-//     case SOGoDateDotFormat:
-//       separator = @".";
-//       break;
-//     case SOGoDateDashFormat:
-//       separator = @".";
-//       break;
-//     default:
-//       separator = @"/";
-//     }
-
-//   return separator;
-// }
-
-// - (NSString *) _dateFormatForDate: (NSCalendarDate *) date
-//                    withFormat: (unsigned int) format
-//                  andSeparator: (NSString *) separator
-// {
-//   NSString *day, *month, *year;
-//   NSString *formattedDate;
-
-//   day = [NSString stringWithFormat: @"%.2d", [date dayOfMonth]];
-//   month = [NSString stringWithFormat: @"%.2d", [date monthOfYear]];
-//   if (format & SOGoDateTwoDigitsYearFormat)
-//     year = [NSString stringWithFormat: @"%.2d", [date yearOfCommonEra] % 100];
-//   else
-//     year = [NSString stringWithFormat: @"%.4d", [date yearOfCommonEra]];
-
-//   if (format & SOGoDateDMYFormat)
-//     formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@",
-//                           day, separator, month, separator, year];
-//   else if (format & SOGoDateMDYFormat)
-//     formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@",
-//                           month, separator, day, separator, year];
-//   else
-//     formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@",
-//                           year, separator, month, separator, day];
-
-//   return formattedDate;
-// }
-
-// - (NSString *) date: (NSCalendarDate *) date
-//      withFormat: (unsigned int) format
-// {
-//   NSString *separator;
-
-//   separator = [self _separatorForFormat: format];
-  
-//   return [self _dateFormatForDate: date
-//            withFormat: format
-//            andSeparator: separator];
-// }
-
-// - (NSString *) date: (NSCalendarDate *) date
-//        withNSFormat: (NSNumber *) format
-// {
-//   return [self date: date withFormat: [format unsignedIntValue]];
-// }
-
 @end /* SOGoDateFormatter */
index 2444791ab0cceef68d75474d7218b8fa4254116c..0a707bc5cd713c19077db53b62b92520fac1264b 100644 (file)
@@ -497,24 +497,24 @@ static BOOL uixDebugEnabled = NO;
              languages: languages];
 }
 
-- (NSString *) localizedNameForDayOfWeek:(unsigned)_dayOfWeek {
-  NSString *key =  [dayLabelKeys objectAtIndex:_dayOfWeek % 7];
-  return [self labelForKey:key];
+- (NSString *) localizedNameForDayOfWeek: (unsigned) dayOfWeek
+{
+  return [self labelForKey: [dayLabelKeys objectAtIndex: dayOfWeek % 7]];
 }
 
-- (NSString *)localizedAbbreviatedNameForDayOfWeek:(unsigned)_dayOfWeek {
-  NSString *key =  [abbrDayLabelKeys objectAtIndex:_dayOfWeek % 7];
-  return [self labelForKey:key];
+- (NSString *) localizedAbbreviatedNameForDayOfWeek: (unsigned) dayOfWeek
+{
+  return [self labelForKey: [abbrDayLabelKeys objectAtIndex: dayOfWeek % 7]];
 }
 
-- (NSString *)localizedNameForMonthOfYear:(unsigned)_monthOfYear {
-  NSString *key =  [monthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12];
-  return [self labelForKey:key];
+- (NSString *) localizedNameForMonthOfYear: (unsigned) monthOfYear
+{
+  return [self labelForKey: [monthLabelKeys objectAtIndex: (monthOfYear - 1) % 12]];
 }
 
-- (NSString *)localizedAbbreviatedNameForMonthOfYear:(unsigned)_monthOfYear {
-  NSString *key =  [abbrMonthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12];
-  return [self labelForKey:key];
+- (NSString *) localizedAbbreviatedNameForMonthOfYear: (unsigned) monthOfYear
+{
+  return [self labelForKey: [abbrMonthLabelKeys objectAtIndex: (monthOfYear - 1) % 12]];
 }
 
 /* HTTP method safety */
index 5ab7be0dafa252795263bf94982c22f3b0648a22..ce59b9e084e7c8c218788c265b5faaeb1209f553 100644 (file)
@@ -9,71 +9,71 @@
 @implementation UIxCalMonthOverview
 
 - (void)dealloc {
-  [self->currentWeekStart release];
+  [currentWeekStart release];
   [super dealloc];
 }
 
 - (void)configureFormatters {
   [super configureFormatters];
   
-  [self->aptFormatter        setShortTitleOnly];
-  [self->privateAptFormatter setPrivateTitleOnly];
+  [aptFormatter        setShortTitleOnly];
+  [privateAptFormatter setPrivateTitleOnly];
 }
 
 - (void)setDayIndex:(int)_idx {
-    self->dayIndex = _idx;
+  dayIndex = _idx;
 }
 
 - (int)dayIndex {
-    return self->dayIndex;
+  return dayIndex;
 }
 
 - (void)setDayOfWeek:(int)_day {
-    self->dayOfWeek = _day;
+  dayOfWeek = _day;
 }
 
 - (int)dayOfWeek {
-    return self->dayOfWeek;
+  return dayOfWeek;
 }
 
 - (void)setCurrentWeekStartDate:(NSCalendarDate *)_date {
-    ASSIGN(self->currentWeekStart, _date);
+  ASSIGN(currentWeekStart, _date);
 }
 
 - (NSCalendarDate *)currentWeekStartDate {
-    return self->currentWeekStart;
+  return currentWeekStart;
 }
 
 - (void)setWeekOfYear:(int)_week {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
     
-    self->weekOfYear = _week;
-    if(_week == 52 || _week == 53)
-        date = [[self startOfMonth] mondayOfWeek];
-    else
-        date = [self startOfMonth];
-    date = [date mondayOfWeek:_week];
-    [self setCurrentWeekStartDate:date];
+  weekOfYear = _week;
+  if(_week == 52 || _week == 53)
+    date = [[self startOfMonth] mondayOfWeek];
+  else
+    date = [self startOfMonth];
+  date = [date mondayOfWeek:_week];
+  [self setCurrentWeekStartDate:date];
 }
 
 - (int)weekOfYear {
-    return self->weekOfYear;
+  return weekOfYear;
 }
 
 - (int)year {
-    return [[self startOfMonth] yearOfCommonEra];
+  return [[self startOfMonth] yearOfCommonEra];
 }
 
 - (int)month {
-    return [[self startOfMonth] monthOfYear];
+  return [[self startOfMonth] monthOfYear];
 }
 
 - (NSString *)localizedDayOfWeekName {
-    return [self localizedNameForDayOfWeek:self->dayOfWeek];
+  return [self localizedNameForDayOfWeek:dayOfWeek];
 }
 
 - (NSDictionary *)currentWeekQueryParameters {
-    return [self queryParametersBySettingSelectedDate:self->currentWeekStart];
+  return [self queryParametersBySettingSelectedDate:currentWeekStart];
 }
 
 
 
 
 - (NSString *)weekStyle {
-    if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]])
-        return @"monthoverview_week_hilite";
-    return @"monthoverview_week";
+  if([currentWeekStart isDateInSameWeek:[NSCalendarDate date]])
+    return @"monthoverview_week_hilite";
+  return @"monthoverview_week";
 }
 
 - (NSString *)contentStyle {
-    if([self->currentDay isToday])
-        return @"monthoverview_content_hilite";
-    else if([self->currentDay monthOfYear] != [[self startOfMonth] monthOfYear])
-        return @"monthoverview_content_dimmed";
-    return @"monthoverview_content";
+  if([currentDay isToday])
+    return @"monthoverview_content_hilite";
+  else if([currentDay monthOfYear] != [[self startOfMonth] monthOfYear])
+    return @"monthoverview_content_dimmed";
+  return @"monthoverview_content";
 }
 
 
index 292e98cafaf822fce7ee6cc5efccbc611b7f6e69..d44de015dc241e3e32c35c09566ec55c158400a5 100644 (file)
@@ -7,27 +7,20 @@
 
 @implementation UIxCalMonthViewOld
 
-- (NSCalendarDate *)startOfMonth {
+- (NSCalendarDate *) startOfMonth
+{
   return [[[super startDate] firstDayOfMonth] beginOfDay];
 }
 
-- (NSCalendarDate *)startDate {
+- (NSCalendarDate *) startDate
+{
   return [[self startOfMonth] mondayOfWeek];
 }
 
-- (NSCalendarDate *)endDate {
-  NSCalendarDate *date;
-  
-  date = [self startOfMonth];
-  date = [date dateByAddingYears:0 months:0 days:[date numberOfDaysInMonth]
-               hours:0 minutes:0 seconds:0];
-  date = [[date sundayOfWeek] endOfDay];
-  return date;
-}
-
 /* URLs */
 
-- (NSDictionary *)prevMonthQueryParameters {
+- (NSDictionary *) prevMonthQueryParameters
+{
   NSCalendarDate *date;
 
   date = [[self startOfMonth] dateByAddingYears:0 months:-1 days:0
@@ -35,7 +28,8 @@
   return [self queryParametersBySettingSelectedDate:date];
 }
 
-- (NSDictionary *)nextMonthQueryParameters {
+- (NSDictionary *)nextMonthQueryParameters
+{
   NSCalendarDate *date;
     
   date = [[self startOfMonth] dateByAddingYears:0 months:1 days:0