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

Define behaviour when no time zone is used within a region #47

Closed
anba opened this issue Sep 8, 2021 · 5 comments
Closed

Define behaviour when no time zone is used within a region #47

anba opened this issue Sep 8, 2021 · 5 comments

Comments

@anba
Copy link
Contributor

anba commented Sep 8, 2021

TimeZonesOfLocale ( loc )

  • Define behaviour when region is an unsupported region.
  • For example what is the return value of TimeZonesOfLocale("und-ZX"), where "ZX" isn't a registered region subtag, or what is returned for TimeZonesOfLocale("und-ZZ"), where "ZZ" is the unknown region placeholder, also what should be returned for larger regions like TimeZonesOfLocale("und-019"), where "019" is the region subtag for the Americas?
@anba anba mentioned this issue Sep 8, 2021
@FrankYFTang
Copy link
Collaborator

Currently it is defined as "of those in common use in region."
I am not sure do we need to be more specific than that. Do you have any specific suggestion of how to specify?

@anba
Copy link
Contributor Author

anba commented Sep 10, 2021

The current specification requires that the array returned from TimeZonesOfLocale has at least one element. Should implementations just make up the most commonly used time zone when no actual data is present?

For example here's what V8 returns for the specific cases mentioned above:

d8> new Intl.Locale("und-ZX").timeZones
[]
d8> new Intl.Locale("und-ZZ").timeZones
[]
d8> new Intl.Locale("und-019").timeZones
[]

This is clearly not compliant to the current specification, because the returned array has zero elements, but at least one element is required to be returned.

@FrankYFTang
Copy link
Collaborator

hum... make sense
should we change
"Let list be a List of 1 or more unique time zone identifiers,"
to
"Let list be a List of 0 or more unique time zone identifiers," ?

@anba
Copy link
Contributor Author

anba commented Sep 14, 2021

Let list be a List of 0 or more unique time zone identifiers, [...], of those in common use in region.

"0 or more" reads a bit strange to me when we want to express the list can have any number of elements.

What about something along the lines of:

Let list be a List of unique time zone identifiers, [...], of those in common use in region. If no time zones are commonly used in region, let list be a new empty List.

This way we explicitly say under which conditions the list can be empty.

@ByteEater-pl
Copy link

Should implementations just make up the most commonly used time zone when no actual data is present?

How about GMT?

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

No branches or pull requests

3 participants