Fixed: issue with _dateWithTimeZone when timeZone is null

Fixed the private method _dateWithTimeZone when aTimeZone is null
This commit is contained in:
Alexandre Wilhelm committed 2014-01-14 15:10:55 -08:00
1 parent 8b975f50dd
commit 1dc84f9b58
1 file changed
+4 -1
+4 -1
View File
@@ -1224,7 +1224,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4,
// Interpret @"" as the date 2000-01-01 00:00:00 +0000, like in Cocoa. No idea why they picked this particular date.
if (!aString)
return [[CPDate alloc] initWithTimeIntervalSinceReferenceDate:-31622400];
if (aFormat == nil)
return nil;
@@ -2119,6 +2119,9 @@ var CPDateFormatterDateStyleKey = @"CPDateFormatterDateStyle",
*/
- (void)_dateWithTimeZone:(CPTimeZone)aTimeZone
{
if (!aTimeZone)
return;
self.setSeconds(self.getSeconds() - [aTimeZone secondsFromGMTForDate:self]);
self.setSeconds(self.getSeconds() + [aTimeZone secondsFromGMT]);
}