Added iOS 4.0 and later methods to NSDateComponents. These methods will probably show up in OS X 10.7 and are easy enough to add now.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
stefanbidi 2010-12-31 18:13:39 +00:00
parent a9a86ac576
commit 79e383555b
3 changed files with 49 additions and 1 deletions

View file

@ -390,6 +390,9 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit)
_week = NSUndefinedDateComponent;
_weekday = NSUndefinedDateComponent;
_weekdayOrdinal = NSUndefinedDateComponent;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
_quarter = NSUndefinedDateComponent;
#endif
return self;
}
@ -449,6 +452,16 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit)
return _year;
}
- (NSCalendar *) calendar
{
return _cal;
}
- (NSTimeZone *) timeZone
{
return _tz;
}
- (void) setDay: (NSInteger) v
@ -506,6 +519,22 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit)
_year = v;
}
- (void) setCalendar: (NSCalendar *) cal
{
if (_cal)
RELEASE(_cal);
_cal = RETAIN(cal);
}
- (void) setTimeZone: (NSTimeZone *) tz
{
if (_tz)
RELEASE(_tz);
_tz = RETAIN(tz);
}
- (id) copyWithZone: (NSZone*)zone
{
if (NSShouldRetainWithZone(self, zone))