Fixed initialization bug in NSDateFormatter and implement NSCalendar-components:fromDate:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31933 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
stefanbidi 2011-01-23 17:10:21 +00:00
parent 07f39f7639
commit e40d187b01
3 changed files with 43 additions and 2 deletions

View file

@ -88,6 +88,8 @@ static NSDateFormatterBehavior _defaultBehavior = 0;
_locale = RETAIN([NSLocale currentLocale]);
_tz = RETAIN([NSTimeZone defaultTimeZone]);
[self _resetUDateFormat];
/* According to Apple docs, default behavior is NSDateFormatterBehavior10_4 on
10.5 and later. Yeah, go figure. */
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) && GS_USE_ICU == 1
@ -107,8 +109,6 @@ static NSDateFormatterBehavior _defaultBehavior = 0;
NSZoneFree ([self zone], value);
#endif
[self _resetUDateFormat];
return self;
}