Skip to content

Improve docs of TimeZoneVariant #6704

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Improve docs of TimeZoneVariant #6704

wants to merge 11 commits into from

Conversation

sffc
Copy link
Member

@sffc sffc commented Jun 24, 2025

Copy link

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

@sffc
Copy link
Member Author

sffc commented Jun 24, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the documentation for TimeZoneVariant, clarifying its behavior with helpful explanations and examples. The suggestions aim to further refine the wording for enhanced clarity.

@sffc sffc added the discuss Discuss at a future ICU4X-SC meeting label Jun 24, 2025
@sffc sffc requested a review from robertbastian June 27, 2025 00:14
@sffc
Copy link
Member Author

sffc commented Jun 27, 2025

I feel that the docs are better than the status quo. The new docs are precise and accurate. The old docs are misleading at best. Remember that our audience is prone to making incorrect assumptions, so we want to make sure that the docs are accurate and don't feed into those assumptions about how time zones work.

@sffc sffc removed the discuss Discuss at a future ICU4X-SC meeting label Jun 27, 2025
Manishearth
Manishearth previously approved these changes Jun 27, 2025
Co-authored-by: Robert Bastian <4706271+robertbastian@users.noreply.github.com>
@sffc sffc requested a review from robertbastian July 10, 2025 05:55
@@ -48,7 +48,7 @@
//! Many zones use different names and offsets in the summer than in the winter. In ICU4X,
//! this is called the _zone variant_.
//!
//! CLDR has two zone variants, named `"standard"` and `"daylight"`. However, the mapping of these
//! CLDR has two zone variants. Although they are named `"standard"` and `"daylight"`, the mapping of these
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the mapping is pretty consistent if we say standard is the standard offset and daylight is higher. I also don't see the point of introducing winter and summer concepts here. They consistently represent standard and daylight time, which is usually observed during summer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased.

@@ -203,19 +219,25 @@ pub(crate) mod ule {
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[non_exhaustive]
pub enum TimeZoneVariant {
/// The variant corresponding to `"standard"` in CLDR.
/// Indicates the period in a time zone with a lower UTC offset.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also want to remove the Standard = lower definition here. Please have a look at my draft: https://github.com/unicode-org/icu4x/pull/6713/files#diff-dd9bce37cba94e980431a686c194069fb7d4ed0275434b9301a369ab4e44558b

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworded this to state "lower than Daylight" and that all time zones use this variant.

sffc and others added 3 commits July 10, 2025 14:22
Co-authored-by: Robert Bastian <4706271+robertbastian@users.noreply.github.com>
@sffc sffc requested a review from robertbastian July 10, 2025 21:38
Comment on lines 247 to 248
/// Although CLDR calls this variant `"daylight"`, the semantics vary
/// from time zone to time zone. The time zone display name of this variant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I don't actually think the "semantics" vary, it's always the higher-offset zone. The display names vary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded

sffc and others added 3 commits July 10, 2025 16:11
Co-authored-by: Robert Bastian <4706271+robertbastian@users.noreply.github.com>
@sffc sffc requested a review from robertbastian July 10, 2025 23:23
Comment on lines +196 to +198
/// offset from UTC than the `Standard` variant. Although these definitions
/// correspond to daylight saving time as observed in some parts of the world,
/// the actual behavior may or may not be intuitive; for example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not get carried away here, 3 out of 490 zones have exceptions

Suggested change
/// offset from UTC than the `Standard` variant. Although these definitions
/// correspond to daylight saving time as observed in some parts of the world,
/// the actual behavior may or may not be intuitive; for example:
/// offset from UTC than the `Standard` variant. Although these definitions
/// correspond to daylight saving time as observed in most of the world,
/// some zones exhibit unintuitive behavior:

@@ -203,19 +225,29 @@ pub(crate) mod ule {
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[non_exhaustive]
pub enum TimeZoneVariant {
/// The variant corresponding to `"standard"` in CLDR.
/// Indicates the period in a time zone with a lower UTC offset than `Daylight`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like defining standard in terms of daylight, because most zones don't have a daylight variant...

Comment on lines +236 to +238
/// Although CLDR calls this variant `"standard"`, the display names vary
/// from time zone to time zone. The time zone display name of this variant
/// may or may not be called "Standard Time".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Although CLDR calls this variant `"standard"`, the display names vary
/// from time zone to time zone. The time zone display name of this variant
/// may or may not be called "Standard Time".
/// Although CLDR calls this variant `"standard"`, the display names vary
/// between time zones and locales and may or may not include the term
/// "Standard Time" or a translation thereof.

Comment on lines +248 to +250
/// Although CLDR calls this variant `"daylight"`, the display names vary
/// from time zone to time zone. The time zone display name of this variant
/// may or may not be called "Daylight Time".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Although CLDR calls this variant `"daylight"`, the display names vary
/// from time zone to time zone. The time zone display name of this variant
/// may or may not be called "Daylight Time".
/// Although CLDR calls this variant `"daylight"`, the display names vary
/// between time zones and locales and may or may not include the term
/// "Daylight Time" or a translation thereof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants