mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
commit missed file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4763 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6812c6aa5f
commit
388c61dbaa
1 changed files with 100 additions and 92 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -122,7 +122,7 @@
|
|||
return [self class];
|
||||
}
|
||||
|
||||
- replacementObjectForPortCoder: aRmc
|
||||
- (id) replacementObjectForPortCoder: (NSPortCoder*)aRmc
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
@ -145,10 +145,13 @@
|
|||
- (void) dealloc
|
||||
{
|
||||
RELEASE(calendar_format);
|
||||
RELEASE(time_zone);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// Initializing an NSCalendar Date
|
||||
/*
|
||||
* Initializing an NSCalendar Date
|
||||
*/
|
||||
- (id) initWithString: (NSString *)description
|
||||
{
|
||||
// +++ What is the locale?
|
||||
|
@ -166,11 +169,11 @@
|
|||
locale: nil];
|
||||
}
|
||||
|
||||
//
|
||||
// This function could possibly be written better
|
||||
// but it works ok; currently ignores locale
|
||||
// information and some specifiers.
|
||||
//
|
||||
/*
|
||||
* This function could possibly be written better
|
||||
* but it works ok; currently ignores locale
|
||||
* information and some specifiers.
|
||||
*/
|
||||
- (id) initWithString: (NSString *)description
|
||||
calendarFormat: (NSString *)format
|
||||
locale: (NSDictionary *)locale
|
||||
|
@ -487,9 +490,9 @@
|
|||
s += second;
|
||||
|
||||
// Assign time zone detail
|
||||
time_zone = [aTimeZone
|
||||
time_zone = RETAIN([aTimeZone
|
||||
timeZoneDetailForDate:
|
||||
[NSDate dateWithTimeIntervalSinceReferenceDate: s]];
|
||||
[NSDate dateWithTimeIntervalSinceReferenceDate: s]]);
|
||||
|
||||
// Adjust date so it is correct for time zone.
|
||||
s -= [time_zone timeZoneSecondsFromGMT];
|
||||
|
@ -519,7 +522,7 @@
|
|||
NSTimeInterval newOffset;
|
||||
|
||||
oldOffset = [time_zone timeZoneSecondsFromGMT];
|
||||
time_zone = z;
|
||||
ASSIGN(time_zone, z);
|
||||
newOffset = [time_zone timeZoneSecondsFromGMT];
|
||||
s += newOffset - oldOffset;
|
||||
}
|
||||
|
@ -563,13 +566,18 @@
|
|||
if (!calendar_format)
|
||||
calendar_format = @"%Y-%m-%d %H:%M:%S %z";
|
||||
if (!time_zone)
|
||||
time_zone = [[NSTimeZone localTimeZone] timeZoneDetailForDate: self];
|
||||
time_zone = RETAIN([[NSTimeZone localTimeZone]
|
||||
timeZoneDetailForDate: self]);
|
||||
return self;
|
||||
}
|
||||
|
||||
// Retreiving Date Elements
|
||||
- (void)getYear: (int *)year month: (int *)month day: (int *)day
|
||||
hour: (int *)hour minute: (int *)minute second: (int *)second
|
||||
- (void) getYear: (int *)year
|
||||
month: (int *)month
|
||||
day: (int *)day
|
||||
hour: (int *)hour
|
||||
minute: (int *)minute
|
||||
second: (int *)second
|
||||
{
|
||||
int h, m;
|
||||
double a, b, c, d = [self dayOfCommonEra];
|
||||
|
@ -743,14 +751,12 @@
|
|||
// Getting String Descriptions of Dates
|
||||
- (NSString*) description
|
||||
{
|
||||
return [self descriptionWithCalendarFormat: calendar_format
|
||||
locale: nil];
|
||||
return [self descriptionWithCalendarFormat: calendar_format locale: nil];
|
||||
}
|
||||
|
||||
- (NSString*) descriptionWithCalendarFormat: (NSString *)format
|
||||
{
|
||||
return [self descriptionWithCalendarFormat: format
|
||||
locale: nil];
|
||||
return [self descriptionWithCalendarFormat: format locale: nil];
|
||||
}
|
||||
|
||||
#define UNIX_REFERENCE_INTERVAL -978307200.0
|
||||
|
@ -1035,6 +1041,7 @@
|
|||
if (newDate)
|
||||
{
|
||||
newDate->calendar_format = [calendar_format copyWithZone: zone];
|
||||
newDate->time_zone = RETAIN(time_zone);
|
||||
}
|
||||
}
|
||||
return newDate;
|
||||
|
@ -1042,8 +1049,7 @@
|
|||
|
||||
- (NSString*) descriptionWithLocale: (NSDictionary *)locale
|
||||
{
|
||||
return [self descriptionWithCalendarFormat: calendar_format
|
||||
locale: locale];
|
||||
return [self descriptionWithCalendarFormat: calendar_format locale: locale];
|
||||
}
|
||||
|
||||
// Getting and Setting Calendar Formats
|
||||
|
@ -1061,7 +1067,9 @@
|
|||
// Getting and Setting Time Zones
|
||||
- (void) setTimeZone: (NSTimeZone *)aTimeZone
|
||||
{
|
||||
time_zone = [aTimeZone timeZoneDetailForDate: self];
|
||||
NSTimeZoneDetail *detail = [aTimeZone timeZoneDetailForDate: self];
|
||||
|
||||
ASSIGN(time_zone, detail);
|
||||
}
|
||||
|
||||
- (NSTimeZoneDetail*) timeZoneDetail
|
||||
|
|
Loading…
Reference in a new issue