No timezone-names in Date() for certain timezones

RESOLVED FIXED in Firefox 40

Status

()

defect
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: elbart, Assigned: elbart)

Tracking

(Blocks 1 bug)

Trunk
mozilla40
x86_64
Windows 7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox40 fixed)

Details

()

Attachments

(3 attachments)

Assignee

Description

5 years ago
Posted 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)".
Assignee

Updated

5 years ago
Blocks: 285663
Assignee

Comment 2

5 years ago
So changing
> c == ' ' || c == '(' || c == ')')) {
to
> c == ' ' || c == '(' || c == ')' || c == '.')) {
could be enough?
Assignee

Comment 3

5 years ago
Posted 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 )
Assignee

Comment 4

5 years ago
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
Assignee

Comment 6

4 years ago
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)
Assignee

Comment 7

4 years ago
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)
Assignee

Comment 9

4 years ago
(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: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Assignee

Comment 12

4 years ago
(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.
Duplicate of this bug: 636228
You need to log in before you can comment on or make changes to this bug.