-
Notifications
You must be signed in to change notification settings - Fork 183
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
Time zone needs for calendar application #2908
Comments
cc @nordzilla @samchen61661 @sffc for time zone stuff |
@leftmostcat thank you for taking time to document your use case needs. This is incredibly helpful for us in shaping the APIs to supply them. Once the module owners and architects decide on the shape of APIs, we will split this into smaller items to allow people to tackle them separately and identify good-first bugs for contributors. |
@leftmostcat Thanks so much for creating this issue. This is all incredibly helpful. I want to go one by one through the things you've listed and address them.
This criteria is subjective, but I certainly hope that this will be achievable with ICU4X's time-zones APIs.
I am not familiar with In particular, it looks like this
ICU4X should be able to provide satisfactory options here, particularly according to the UTS-35 specification.
I'm not sure exactly what you mean here. Metazones are not unique to a territory. Here is an example of one metazone (America/Central) being associated with two different territories in CLDR data. Do you mean for a given metazone, you want to retrieve a list of all territories associated with that metazone?
This will certainly be achievable according to the UTS-35 specifications mentioned above.
We do not currently have plans to expose data in this way.
While this data is available in CLDR, and you will be able to get the correct metazone from the Can you tell me more about the use case for retrieving territory information specifically? As mentioned above, some of the functionality you mentioned is already on the roadmap to support, but other items are not. But that doesn't mean that we can't have a discussion about supporting them and designing APIs that would provide the most useful information in non-confusing and ergonomic ways. I'm thrilled that you brought all of this to the table so that we can continue to have discussions about what time-zone-related APIs should exist beyond the scope of If you have any thoughts, questions or responses, please let me know! |
Thanks for your responses! Replies where needed are inline.
I mentioned what this looks like for us below, but I didn't connect it to this need very well. In order to present a user-friendly list of time zones, we want to combine standard UTC offset, metazone long generic name, and—where a metazone covers multiple territories with distinct IANA time zones—the exemplar locations for the territories. We would have time zones such as the following:
The list of transitions and rules is exactly what we need. In particular, this is a requirement for us as we need to send iCalendar events over the wire, and to ensure compatibility, this means sending the relevant timezone definition as a
Specifically, we want to be able to get the |
If you want to turn "America/Los_Angeles" into "Pacific Time - Los Angeles", you need the metazone and the exemplar city. You don't need a territory for the metazone. I'm not sure if CLDR offers this style out of the box (metazone + location), but it's not a bad idea. |
The problem is arriving at "America/Los_Angeles" in the first place. In order to minimize confusing choices, I was hoping to avoid presenting every canonical time zone; for example, "America/Detroit" and "America/New_York" don't differ meaningfully, and I hoped that iterating over the territories mapped in the CLDR would allow preventing this, but in coming up with this example I realized that "America/Phoenix" is not differentiated in any way from the rest of "America_Mountain" and has no associated territory, so this approach may not be workable, in which case we would just need a way to enumerate all canonical time zones. (Would it be helpful to edit above comments?) |
People who live in Detroit might take offence at that :) I think the best solution is to just take the whole list of (canonicalized) IANA time zone IDs and format them in the best way. The location format is already supported by ICU4X ("Los Angeles Time"), and I think that your proposed format ("Pacific Time - Los Angeles") could work, too, if proposed. FYI, you can now get the full list of IANA time zones through ECMA-402 like this: Intl.supportedValuesOf("timeZone")
(428) ['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', ... ] |
I am currently working on the calendar functionality in Mozilla Thunderbird, which is built on top of the Firefox codebase. At present, we get most of the functionality we need via ICU4C's C++ API. However, this API is not sufficient to provide everything we need and we'll likely want to transition to ICU4X at some point anyhow. In order to address both problems, I'd like to begin working with ICU folks on designing and implementing the time zone functionality we require for the calendar.
Our basic needs are as follows:
VTIMEZONE
definitionWe hope to accomplish this with a combination of IANA tzdb and CLDR data via ICU as follows:
(UTC-08:00) Pacific Time - Los Angeles
or (UTC+05:45) Nepal Time`, localized as appropriate)VTIMEZONE
component stringAt present, we are doing the following in ICU4C:
VTimeZone::createTimeZoneIDEnumeration()
; note that this doesn't allow us to present time zones in the user-friendly manner described above, and ICU4C currently has no facility for enumerating metazone territoriesVTimeZone::write()
The following bugs filed against ICU4C may be relevant in designing the necessary API:
ICU-22236 Cannot enumerate metazone territories
ICU-22175 VTimeZone::createVTimeZoneByID does not return NULL on unknown ID (to wit, it is necessary to distinguish between
Etc/Unknown
—a valid IANA alias—and an invalid timezone ID)The text was updated successfully, but these errors were encountered: