Coder Social home page Coder Social logo

Comments (8)

FrankYFTang avatar FrankYFTang commented on June 22, 2024

I think there are three possible approaches we could consider for this issue

  1. Keep the status quo
  2. Change getWeekInfo() and getHourCycles() to also include the following step
If the unicode_language_id production of locale does not contain the ["-" unicode_region_subtag] sequence, return undefined.
  1. Change getTimeZones() spec to return the value after adding likelySubtag

from proposal-intl-locale-info.

sffc avatar sffc commented on June 22, 2024
new Intl.Locale("en-US").getTimeZones()
// ["America/New_York", "America/Chicago", ...]

new Intl.Locale("en").getTimeZones()
// Current: undefined
// Anba suggestion: same as "en-US" based on likely subtags
// Shane suggestion: ["UTC"]
// Justin suggestion: []

from proposal-intl-locale-info.

FrankYFTang avatar FrankYFTang commented on June 22, 2024

We discussed this in 2023-09-07 TG2, with the following options:

  1. maximize the locale to get the Region then to get the TimeZone
  2. return ["UTC"]
  3. return []
  4. return undefined (AS IS in the current spec text)

attendees supprt keeping the current spec text that return undefined after consider the above options. Close this issue.

from proposal-intl-locale-info.

sffc avatar sffc commented on June 22, 2024

TG2 notes: https://github.com/tc39/ecma402/blob/master/meetings/notes-2023-09-07.md#consistent-region-subtag-requirements-for-gettimezones-and-getweekinfogethourcycles-71

from proposal-intl-locale-info.

anba avatar anba commented on June 22, 2024

@sffc If it's not acceptable for getTimeZones() to use likely-subtags data to fill in missing regions, why is it acceptable that getWeekInfo() uses likely-subtags data to fill in missing regions?

from proposal-intl-locale-info.

sffc avatar sffc commented on June 22, 2024

Good question; the time zone impacts the actual numeric result of the data, whereas week info and hour cycle are about display preferences that have some impact on the layout but don't change the underlying quantity. It is therefore important to make a conscious choice about the time zone.

from proposal-intl-locale-info.

anba avatar anba commented on June 22, 2024

And if we keep the current approach where the region subtag is only strictly required for getTimeZones(), but not for getWeekInfo(), should ICU4X follow suite and also fill in missing region subtags for unicode-org/icu4x#2999, or should this be done in the ICU4X caller?

The relevant ICU4C code is:

from proposal-intl-locale-info.

sffc avatar sffc commented on June 22, 2024

I anticipate that in places where a default can be reasonably derived, such as week info, likely subtags will be used during lookup.

from proposal-intl-locale-info.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.