Closed Bug 1069979 Opened 10 years ago Closed 9 years ago

No timezone-names in Date() for certain timezones

Categories

(Core :: JavaScript Engine, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: elbart, Assigned: elbart)

References

()

Details

Attachments

(3 files)

Attached image timezone names.png
Trying to reproduce bug 912710, I noticed that Firefox wouldn't return the name of my timezone ("W. Europe Daylight Time") at the end of the string, but IE and Chrome do.

After some trial and error I assume that Firefox isn't displaying the timezone-name when it contains a dot, i.e. "W. Europe Daylight Time", "Cen. Australia Standard Time" or "N. Central Asia Standard Time".

Names are registered here: http://mxr.mozilla.org/mozilla-central/source/intl/icu/source/data/misc/windowsZones.txt

Test: new Date().toString();
or open URL

Happening in Windows 7.
In Ubuntu 14.04 and Firefox for Android it's showing "(CEST)".
Blocks: 285663
So changing
> c == ' ' || c == '(' || c == ')')) {
to
> c == ' ' || c == '(' || c == ')' || c == '.')) {
could be enough?
Attached image local build.png
Nightly 01-29 (top) compared to a local build with the change mentioned in comment 2 (used codebase as of revision https://hg.mozilla.org/mozilla-central/rev/0467412f8413 )
What would be the next step?
See Also: → 636228
Basically you just have to create a patch from the change you did locally, attach it to this bug and ask somebody for review. https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch
Don't throw away timezone-strings with dots in Date()

If you you're in a location currently in daylight saving time, and you test the patch on Windows, you'll probably see the wrong string, i.e. normal/standard time instead of summer/daylight saving time.
That's bug 879261.
Attachment #8588366 - Flags: review?(evilpies)
Timezone-strings with other characters are still ignored, e.g. "Mitteleuropäische Sommerzeit" on a German machine because of the umlaut.
That's definitely above my level.
Comment on attachment 8588366 [details] [diff] [review]
Don't throw away timezone-strings with dots in Date()

Review of attachment 8588366 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks for attaching it as a patch. I guess you don't have any commit access?
The comment above this code is somewhat questionable, we should be able to display non-ascii characters.
Attachment #8588366 - Flags: review?(evilpies) → review+
Assignee: nobody → elbart
Flags: needinfo?(evilpies)
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(evilpies)
(In reply to Tom Schuster [:evilpie] from comment #8)
> Comment on attachment 8588366 [details] [diff] [review]
> Don't throw away timezone-strings with dots in Date()
> 
> Review of attachment 8588366 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Looks good, thanks for attaching it as a patch. I guess you don't have any
> commit access?

That's right.

> The comment above this code is somewhat questionable, we should be able to
> display non-ascii characters.

The check is throwing away the string unless is pretty much only spaces, ASCII-letters and numbers:
http://hg.mozilla.org/mozilla-central/file/ab0490972e1e/js/src/jsdate.cpp#l2582
Another victim of this check is "West-Zentralafrika Normalzeit".

I've did a test with that check removed, and the localized timezone string was then shown when trying the jsfiddle-test (URL).
Landed on mozilla-inbound. Should be in the next Nightly after the merge. Thanks again.
https://hg.mozilla.org/integration/mozilla-inbound/rev/6b1f01887b3e
https://hg.mozilla.org/mozilla-central/rev/6b1f01887b3e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
(In reply to Tom Schuster [:evilpie] from comment #8)

> The comment above this code is somewhat questionable, we should be able to
> display non-ascii characters.

Opened follow-up bug 1156728.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: