mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-11 00:30:49 +00:00
Check time zone abbreviations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19203 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
36e9f07725
commit
4ee4567b24
3 changed files with 25 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-04-27 Georg Fleischmann
|
||||||
|
|
||||||
|
* Source/NSCalendarDate.m:
|
||||||
|
(-initWithString:calendarFormat:locale:): avoid exception with
|
||||||
|
time zone abbreviations.
|
||||||
|
|
||||||
|
* Testing/nsdate.m: Add test for this. (<fedor@gnu.org>).
|
||||||
|
|
||||||
2004-04-27 Adam Fedor <fedor@gnu.org>
|
2004-04-27 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/GSHTTPURLHandle.m: Get debugFile path using
|
* Source/GSHTTPURLHandle.m: Get debugFile path using
|
||||||
|
|
|
@ -1083,11 +1083,14 @@ static inline int getDigits(const char *from, char *to, int limit)
|
||||||
{
|
{
|
||||||
NSString *z = [NSString stringWithCString: tmpStr];
|
NSString *z = [NSString stringWithCString: tmpStr];
|
||||||
|
|
||||||
tz = [NSTimeZone timeZoneWithName: z];
|
if ([[NSTimeZone abbreviationDictionary] objectForKey: z])
|
||||||
if (tz == nil)
|
|
||||||
{
|
{
|
||||||
tz = [NSTimeZone timeZoneWithAbbreviation: z];
|
tz = [NSTimeZone timeZoneWithAbbreviation: z];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tz = [NSTimeZone timeZoneWithName: z];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -316,6 +316,18 @@ if ([(NSDate*) [NSCalendarDate date] compare:
|
||||||
printf("Failed on 2003/01/06 is week 2\n");
|
printf("Failed on 2003/01/06 is week 2\n");
|
||||||
else
|
else
|
||||||
printf("All passed\n");
|
printf("All passed\n");
|
||||||
|
|
||||||
|
|
||||||
|
c = [NSCalendarDate dateWithString: @"2004-05-30 00:30:00 HPT"
|
||||||
|
calendarFormat: @"%Y-%m-%d %H:%M:%S %Z"];
|
||||||
|
c1 = [NSCalendarDate dateWithString: @"2004-05-30 00:30:00 HST"
|
||||||
|
calendarFormat: @"%Y-%m-%d %H:%M:%S %Z"];
|
||||||
|
printf("date with time zone abbr %s\n", [[c description] cString]);
|
||||||
|
if ([c isEqual: c1])
|
||||||
|
printf("Passed date with time zone abbreviation\n");
|
||||||
|
else
|
||||||
|
printf("Failed date with time zone abbreviation\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
Loading…
Reference in a new issue