Skip to content
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

Improve field set builders more #5928

Open
3 tasks
sffc opened this issue Dec 19, 2024 · 2 comments
Open
3 tasks

Improve field set builders more #5928

sffc opened this issue Dec 19, 2024 · 2 comments
Assignees
Labels
C-datetime Component: datetime, calendars, time zones S-small Size: One afternoon (small bug fix or enhancement)

Comments

@sffc
Copy link
Member

sffc commented Dec 19, 2024

Things to do:

  • Add .with_time_precision() to date field sets, so the user can write YMD::long().with_time_precision(), getting a YMDT out the other side
  • Rename .zone_z() and friends to .with_zone_z()
  • Make these changes on DateFieldSet as well
@sffc sffc added the C-datetime Component: datetime, calendars, time zones label Dec 19, 2024
@sffc sffc added this to the ICU4X 2.0 ⟨P1⟩ milestone Dec 19, 2024
@sffc sffc self-assigned this Dec 19, 2024
@sffc sffc added the S-small Size: One afternoon (small bug fix or enhancement) label Jan 7, 2025
@robertbastian
Copy link
Member

Rename .zone_z() and friends to .with_zone_z()

As mentioned in the other issue, I'd prefer if we said "time zone" instead of "zone". If you're not in the time zone mindset, it might not be clear what "zone" means.

@sffc
Copy link
Member Author

sffc commented Jan 8, 2025

Do you prefer:

  1. .with_zone_specific
  2. .with_specific_zone
  3. .with_time_zone_specific
  4. .with_specific_time_zone
  5. .with_specific_non_location_time_zone
  6. .with_z_time_zone
  7. .with_time_zone_z

Right now I believe the main branch is on 1.

People using these APIs are already in a datetime mindset and will understand what "zone" means. There will be people who are confused by "zone", but this is mitigated with docs.

To demonstrate the utility of "zone" as a self-contained term, please note the following enum and its variants.

https://unicode-org.github.io/icu4x/rustdoc/icu/datetime/fieldsets/enums/enum.CompositeFieldSet.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-datetime Component: datetime, calendars, time zones S-small Size: One afternoon (small bug fix or enhancement)
Projects
None yet
Development

No branches or pull requests

2 participants