mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-24 01:11:01 +00:00
Merge pull request #258 from gnustep/NSTimeZone-win32-fix
Windows to IANA time zone conversion: remove unsupported daylight conversion
This commit is contained in:
commit
a79190e6bc
3 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
2022-08-07 Hugo Melder <contact@hugomelder.com>
|
||||
|
||||
* Source/NSTimeZone.m:
|
||||
Windows to IANA time zone conversion: remove unsupported
|
||||
TIME_ZONE_ID_DAYLIGHT conversion.
|
||||
* Tests/base/NSTimeZone/use.m:
|
||||
Fix test case to check for the correct standard time zone name.
|
||||
|
||||
2022-08-05 Hugo Melder <contact@hugomelder.com>
|
||||
|
||||
* Tests/base/NSTask/Helpers/GNUmakefile:
|
||||
|
|
|
@ -1447,15 +1447,23 @@ static NSMapTable *absolutes = 0;
|
|||
SetThreadUILanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||
dst = GetTimeZoneInformation(&tz);
|
||||
SetThreadUILanguage(origLangID);
|
||||
|
||||
// Only tz.StandardName time zone conversions are supported, as
|
||||
// the Zone-Tzid table lacks all daylight time conversions:
|
||||
// e.g. 'W. Europe Daylight Time' <-> 'Europe/Berlin' is not listed.
|
||||
//
|
||||
// See: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/zone_tzid.html
|
||||
tzName = tz.StandardName;
|
||||
#else
|
||||
dst = GetTimeZoneInformation(&tz);
|
||||
#endif
|
||||
|
||||
localZoneSource = @"function: 'GetTimeZoneInformation()'";
|
||||
if (dst == TIME_ZONE_ID_DAYLIGHT)
|
||||
tzName = tz.DaylightName;
|
||||
else
|
||||
tzName = tz.StandardName;
|
||||
#endif
|
||||
|
||||
localZoneSource = @"function: 'GetTimeZoneInformation()'";
|
||||
|
||||
#if defined(_MSC_VER) && defined(UCAL_H)
|
||||
// Convert Windows timezone name to IANA identifier
|
||||
|
|
|
@ -65,7 +65,7 @@ int main()
|
|||
testHopeful = YES;
|
||||
PASS_EQUAL(
|
||||
[current localizedName: NSTimeZoneNameStyleStandard locale: locale],
|
||||
@"Brasilia Time",
|
||||
@"Brasilia Standard Time",
|
||||
"Correctly localizes standard time zone name")
|
||||
|
||||
/* The next few depend on ICU issues
|
||||
|
|
Loading…
Reference in a new issue