refactor: replace calls to create GMT NSTimeZone instance
parent
eb13aa14b2
commit
2e46e89d58
|
@ -192,7 +192,7 @@ static inline id GetProperty(NSDictionary *_set, NSString *_name) {
|
||||||
|
|
||||||
if ([val respondsToSelector:@selector(descriptionWithCalendarFormat:)]) {
|
if ([val respondsToSelector:@selector(descriptionWithCalendarFormat:)]) {
|
||||||
static NSTimeZone *gmt = nil;
|
static NSTimeZone *gmt = nil;
|
||||||
if (gmt == nil) gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
|
if (gmt == nil) gmt = [NSTimeZone timeZoneForSecondsFromGMT: 0];
|
||||||
[val setTimeZone:gmt];
|
[val setTimeZone:gmt];
|
||||||
val = [val descriptionWithCalendarFormat:calfmt];
|
val = [val descriptionWithCalendarFormat:calfmt];
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
static NSTimeZone *gmt = nil;
|
static NSTimeZone *gmt = nil;
|
||||||
static inline void _setupGMT(void) {
|
static inline void _setupGMT(void) {
|
||||||
if (gmt == nil)
|
if (gmt == nil)
|
||||||
gmt = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain];
|
gmt = [[NSTimeZone timeZoneForSecondsFromGMT: 0] retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation NSCalendarDate(iCalRepresentation)
|
@implementation NSCalendarDate(iCalRepresentation)
|
||||||
|
|
|
@ -337,7 +337,7 @@
|
||||||
second = 0;
|
second = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
utc = [NSTimeZone timeZoneWithAbbreviation: @"GMT"];
|
utc = [NSTimeZone timeZoneForSecondsFromGMT: 0];
|
||||||
date = [NSCalendarDate dateWithYear: year month: month
|
date = [NSCalendarDate dateWithYear: year month: month
|
||||||
day: day hour: hour minute: minute
|
day: day hour: hour minute: minute
|
||||||
second: second
|
second: second
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
NSCalendarDate *utcStart, *utcEnd;
|
NSCalendarDate *utcStart, *utcEnd;
|
||||||
NSTimeZone *uTZ;
|
NSTimeZone *uTZ;
|
||||||
|
|
||||||
uTZ = [NSTimeZone timeZoneWithAbbreviation: @"GMT"];
|
uTZ = [NSTimeZone timeZoneForSecondsFromGMT: 0];
|
||||||
utcStart = [start copy];
|
utcStart = [start copy];
|
||||||
utcEnd = [end copy];
|
utcEnd = [end copy];
|
||||||
[utcStart setTimeZone: uTZ];
|
[utcStart setTimeZone: uTZ];
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
address = nil;
|
address = nil;
|
||||||
timeZone = [NSTimeZone timeZoneWithAbbreviation: @"GMT"];
|
timeZone = [NSTimeZone timeZoneForSecondsFromGMT: 0];
|
||||||
[timeZone retain];
|
[timeZone retain];
|
||||||
startDate = nil;
|
startDate = nil;
|
||||||
endDate = nil;
|
endDate = nil;
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
|
|
||||||
appName = [[context request] applicationName];
|
appName = [[context request] applicationName];
|
||||||
date = [NSCalendarDate calendarDate];
|
date = [NSCalendarDate calendarDate];
|
||||||
[date setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @"GMT"]];
|
[date setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]];
|
||||||
if (username)
|
if (username)
|
||||||
{
|
{
|
||||||
// Cookie expires in one month
|
// Cookie expires in one month
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
if (cookieReset)
|
if (cookieReset)
|
||||||
{
|
{
|
||||||
date = [NSCalendarDate calendarDate];
|
date = [NSCalendarDate calendarDate];
|
||||||
[date setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @"GMT"]];
|
[date setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]];
|
||||||
[locationCookie setExpires: [date yesterday]];
|
[locationCookie setExpires: [date yesterday]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
cookie = nil;
|
cookie = nil;
|
||||||
|
|
||||||
date = [NSCalendarDate calendarDate];
|
date = [NSCalendarDate calendarDate];
|
||||||
[date setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @"GMT"]];
|
[date setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]];
|
||||||
|
|
||||||
// We cleanup the memecached/database session cache. We do this before
|
// We cleanup the memecached/database session cache. We do this before
|
||||||
// invoking _logoutCookieWithDate: in order to obtain its value.
|
// invoking _logoutCookieWithDate: in order to obtain its value.
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
appName = [rq applicationName];
|
appName = [rq applicationName];
|
||||||
[locationCookie setPath: [NSString stringWithFormat: @"/%@/", appName]];
|
[locationCookie setPath: [NSString stringWithFormat: @"/%@/", appName]];
|
||||||
date = [NSCalendarDate calendarDate];
|
date = [NSCalendarDate calendarDate];
|
||||||
[date setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @"GMT"]];
|
[date setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]];
|
||||||
[locationCookie setExpires: [date yesterday]];
|
[locationCookie setExpires: [date yesterday]];
|
||||||
|
|
||||||
return locationCookie;
|
return locationCookie;
|
||||||
|
|
|
@ -509,7 +509,7 @@
|
||||||
response = [self redirectToLocation: [self _logoutRedirectURL]];
|
response = [self redirectToLocation: [self _logoutRedirectURL]];
|
||||||
|
|
||||||
date = [NSCalendarDate calendarDate];
|
date = [NSCalendarDate calendarDate];
|
||||||
[date setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @"GMT"]];
|
[date setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]];
|
||||||
|
|
||||||
// We cleanup the memecached/database session cache. We do this before
|
// We cleanup the memecached/database session cache. We do this before
|
||||||
// invoking _logoutCookieWithDate: in order to obtain its value.
|
// invoking _logoutCookieWithDate: in order to obtain its value.
|
||||||
|
|
Loading…
Reference in New Issue