New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not a complete list of time zones and their aliases #756
Comments
Well, the following test code shows that the aliases can be recognized. You see different timezone identifiers but exactly the same rules:
Ah wait a moment, your question is about an internal detail of winzone-mapping. I will look into it. |
Actually, Time4J supports aliases in general but only in one direction, namely resolving aliases internally to the real IANA-identifiers. Similar direction is valid for windows-zone-identifiers. The non-public-api-map you are actually using contains entries like:
This map is optimized for the purpose of look up of winzones in combination with a country-id and does not need to know about aliases like "Asia/Tel_Aviv" (in this direction). I have now following new methods for the reverse direction in mind: class Timezone:
class WindowsZone:
|
Now I have released Time4A-v3.41 and the misc-module in version v3.41. Following features have been added so you should be able to solve your problem without accessing internal implementations:
Some notes about your alias map:
I appreciate any feedback very much if the new version works for you. |
Now I have even released the misc-module in the version v3.41.1 which contains an automatic fallback to territory "001" (the CLDR-symbol for "worldwide") if the windows zone name does not exist for a given country identifier. So your issue is pretty much solved (the tzdata-module which is necessary for normalizing any aliases is already included in the latest Time4A-version). |
@MenoData Thanks, Your changes help me :)
I first tried to use the latest version of the "misc" library 4.38, but it is not working with them :( |
Thanks for your feedback. I have already learnt that Android architecture is not optimized for a modular Time4A, so I think the winzone-classes should just be added to Time4A directly - without an extra aar-file. However, I should then look for an option how to register or unregister these additional tz-identifiers to the tz-repository of Time4A. |
Time4A with version 4.4 contains the win-zone-support, so only one dependency is needed (not yet released however):
Example for working code in Time4A:
Output: "Winzone: WINDOWS~Europe/Paris=>Romance Standard Time" Attention: If you need expressions like |
For your information: Time4A (4.4-2019a) has been released today. |
In our android project we use WinZoneProviderSPI.NAME_BASED_MAP for converting the iana timeszone to windows. But we are forced to use a crutch like this, because on some devices the timeszone is determined by its alias. Link on source Wiki. The first value is something that is not in the library but is an alias, the second value is what is.
The text was updated successfully, but these errors were encountered: