mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
a9a86ac576
commit
79e383555b
3 changed files with 49 additions and 1 deletions
|
@ -1,8 +1,13 @@
|
||||||
|
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||||
|
|
||||||
|
* Headers/Foundation/NSCalendar.h:
|
||||||
|
* Source/NSCalendar.m: Added iOS 4.0 and later methods to NSDateComponents.
|
||||||
|
|
||||||
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||||
|
|
||||||
* Resources/GNUmakefile:
|
* Resources/GNUmakefile:
|
||||||
* Resources/Languages/Locale.canonical: Added mapping to go from long
|
* Resources/Languages/Locale.canonical: Added mapping to go from long
|
||||||
locale identifiers to short identifiers used by ICU.
|
locale identifiers to the shorter identifiers used by ICU.
|
||||||
* Source/NSLocale.m: Implemented -canonical* and -preferredLanaguges methods.
|
* Source/NSLocale.m: Implemented -canonical* and -preferredLanaguges methods.
|
||||||
|
|
||||||
2010-12-31 14:03 David Chisnall <theraven@gna.org>
|
2010-12-31 14:03 David Chisnall <theraven@gna.org>
|
||||||
|
|
|
@ -83,6 +83,12 @@ enum
|
||||||
NSInteger _weekday;
|
NSInteger _weekday;
|
||||||
NSInteger _weekdayOrdinal;
|
NSInteger _weekdayOrdinal;
|
||||||
NSInteger _quarter;
|
NSInteger _quarter;
|
||||||
|
// FIXME: In reality these are only available on iOS > 4. Will probably show
|
||||||
|
// up in OS X 10.7.
|
||||||
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||||
|
NSCalendar *_cal;
|
||||||
|
NSTimeZone *_tz;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSInteger) day;
|
- (NSInteger) day;
|
||||||
|
@ -112,6 +118,14 @@ enum
|
||||||
- (NSInteger) quarter;
|
- (NSInteger) quarter;
|
||||||
- (void) setQuarter: (NSInteger) v;
|
- (void) setQuarter: (NSInteger) v;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// FIXME: In reality these are only available on iOS > 4.
|
||||||
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||||
|
- (NSCalendar *) calendar;
|
||||||
|
- (NSTimeZone *) timeZone;
|
||||||
|
- (void) setCalendar: (NSCalendar *) cal;
|
||||||
|
- (void) setTimeZone: (NSTimeZone *) tz;
|
||||||
|
#endif
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -390,6 +390,9 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit)
|
||||||
_week = NSUndefinedDateComponent;
|
_week = NSUndefinedDateComponent;
|
||||||
_weekday = NSUndefinedDateComponent;
|
_weekday = NSUndefinedDateComponent;
|
||||||
_weekdayOrdinal = NSUndefinedDateComponent;
|
_weekdayOrdinal = NSUndefinedDateComponent;
|
||||||
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||||
|
_quarter = NSUndefinedDateComponent;
|
||||||
|
#endif
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -449,6 +452,16 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit)
|
||||||
return _year;
|
return _year;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSCalendar *) calendar
|
||||||
|
{
|
||||||
|
return _cal;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSTimeZone *) timeZone
|
||||||
|
{
|
||||||
|
return _tz;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (void) setDay: (NSInteger) v
|
- (void) setDay: (NSInteger) v
|
||||||
|
@ -506,6 +519,22 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit)
|
||||||
_year = v;
|
_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
|
- (id) copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
if (NSShouldRetainWithZone(self, zone))
|
if (NSShouldRetainWithZone(self, zone))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue