mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-13 01:08:50 +00:00
Monotone-Parent: 820b27e801f0d5e9a95d74d782342e33456b3b4d
Monotone-Revision: c818bd7fb6cf31cc71d77656fd51138b3237c073 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-08T15:26:46 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#import "SOGoJSStringFormatter.h"
|
||||
#import "NSString+URL.h"
|
||||
#import "common.h"
|
||||
|
||||
#import <NGObjWeb/SoHTTPAuthenticator.h>
|
||||
#import <NGObjWeb/WOResourceManager.h>
|
||||
|
||||
@@ -37,8 +38,6 @@
|
||||
|
||||
@implementation UIxComponent
|
||||
|
||||
static NSTimeZone *GMT = nil;
|
||||
|
||||
static NSMutableArray *dayLabelKeys = nil;
|
||||
static NSMutableArray *abbrDayLabelKeys = nil;
|
||||
static NSMutableArray *monthLabelKeys = nil;
|
||||
@@ -59,9 +58,6 @@ static BOOL uixDebugEnabled = NO;
|
||||
|
||||
uixDebugEnabled = [ud boolForKey:@"SOGoUIxDebugEnabled"];
|
||||
|
||||
if (!GMT)
|
||||
GMT = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain];
|
||||
|
||||
if (dayLabelKeys == nil) {
|
||||
dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
|
||||
[dayLabelKeys addObject:@"Sunday"];
|
||||
@@ -115,7 +111,6 @@ static BOOL uixDebugEnabled = NO;
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
viewTimeZone = nil;
|
||||
_selectedDate = nil;
|
||||
}
|
||||
|
||||
@@ -125,8 +120,6 @@ static BOOL uixDebugEnabled = NO;
|
||||
- (void) dealloc
|
||||
{
|
||||
[self->queryParameters release];
|
||||
if (viewTimeZone)
|
||||
[viewTimeZone release];
|
||||
if (_selectedDate)
|
||||
[_selectedDate release];
|
||||
[super dealloc];
|
||||
@@ -377,28 +370,6 @@ static BOOL uixDebugEnabled = NO;
|
||||
|
||||
/* date */
|
||||
|
||||
- (NSTimeZone *) viewTimeZone
|
||||
{
|
||||
NSUserDefaults *userPrefs;
|
||||
SOGoUser *currentUser;
|
||||
|
||||
if (!viewTimeZone)
|
||||
{
|
||||
currentUser = [[self context] activeUser];
|
||||
userPrefs = [currentUser userDefaults];
|
||||
viewTimeZone = [NSTimeZone timeZoneWithName:
|
||||
[userPrefs stringForKey: @"timezonename"]];
|
||||
[viewTimeZone retain];
|
||||
}
|
||||
|
||||
return viewTimeZone;
|
||||
}
|
||||
|
||||
- (NSTimeZone *) backendTimeZone
|
||||
{
|
||||
return GMT;
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) selectedDate
|
||||
{
|
||||
NSString *s, *dateString;
|
||||
@@ -410,7 +381,7 @@ static BOOL uixDebugEnabled = NO;
|
||||
s = [self queryParameterForKey: @"day"];
|
||||
if ([s length] > 0)
|
||||
dateString = [s stringByAppendingFormat: @" %@",
|
||||
[[self viewTimeZone] abbreviation]];
|
||||
[[[self clientObject] userTimeZone] abbreviation]];
|
||||
else
|
||||
{
|
||||
cdate = [NSCalendarDate calendarDate];
|
||||
@@ -418,7 +389,7 @@ static BOOL uixDebugEnabled = NO;
|
||||
[cdate yearOfCommonEra],
|
||||
[cdate monthOfYear],
|
||||
[cdate dayOfMonth],
|
||||
[[self viewTimeZone] abbreviation]];
|
||||
[[[self clientObject] userTimeZone] abbreviation]];
|
||||
}
|
||||
|
||||
cdate = [NSCalendarDate dateWithString: dateString
|
||||
@@ -440,7 +411,7 @@ static BOOL uixDebugEnabled = NO;
|
||||
}
|
||||
|
||||
- (NSString *)dateStringForDate:(NSCalendarDate *)_date {
|
||||
[_date setTimeZone:[self viewTimeZone]];
|
||||
[_date setTimeZone: [[self clientObject] userTimeZone]];
|
||||
return [_date descriptionWithCalendarFormat:@"%Y%m%d"];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user