Closed Bug 1198543 Opened 9 years ago Closed 5 years ago

toLocaleString with no parameters caches timezone

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1300110
Tracking Status
firefox43 --- affected

People

(Reporter: zbraniecki, Unassigned)

References

Details

When I pass first parameter to toLocaleString it does use the current timezone properly, but if I omit the first parameter, it does use the old timezone.

Steps to reproduce:

1) Set a timezone on your device to America/Los Angeles
2) Restart a phone
3) (new Date()).toLocaleString(navigator.languages); // proper local datetime with America/Los Angeles timezone
4) (new Date()).toLocaleString(); // proper local datetime with America/Los Angeles timezone
5) Change time zone to America/New York
6) (new Date()).toLocaleString(navigator.languages); // proper local datetime with America/New York timezone
7) (new Date()).toLocaleString(); // old datetime with America/Los Angeles timezone

Expected result:

In setp 7) the datetime should use America/New York
Depends on: 1172609
[16:40:12] Waldo:	gandalf: it's a bug, we're trying to cache a formatter a bit too hard
Bug 1205546 fixed some aspects of this, on systems that notify when the system time zone changes.

But if you move between time zones with identical time zone adjustment, no change will be detected -- e.g. you might see a stale "MST" in a string instead of "PDT", if you moved between the two.  So this is partially fixed.
Depends on: 837961
Depends on: 1343826

Let's dup this to bug 1300110 for the missing time zone updates (and bug 1300110 for the identical time zone adjustment issue).

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.