Add fractionalSecondDigits option to Intl.DateTimeFormat
Categories
(Core :: JavaScript: Internationalization API, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
()
Details
(Keywords: dev-doc-needed)
Attachments
(1 file)
The spec PR https://github.com/tc39/ecma402/pull/347 adds support for the "fractionalSecondDigits" option to Intl.DateTimeFormat
.
Example:
js> new Intl.DateTimeFormat("en", {second:"numeric", fractionalSecondDigits:3}).format(new Date("2019-07-23T00:00:00.123"))
"0.123"
js> new Intl.DateTimeFormat("en", {second:"numeric", fractionalSecondDigits:2}).format(new Date("2019-07-23T00:00:00.023"))
"0.02"
Assignee | ||
Comment 1•6 years ago
|
||
Nightly-only for now until the open spec issues are addressed.
Drive-by change:
Implement the "unknown" parts change from https://github.com/tc39/ecma402/pull/245.
Assignee | ||
Comment 2•6 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=60e36f038c4e5eca7b086b38df7853c9fb684719
Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/74572aae39b0
Add support for "fractionalSecondDigits" option to Intl.DateTimeFormat. r=jwalden
Comment 4•6 years ago
|
||
bugherder |
Assignee | ||
Comment 5•6 years ago
|
||
From https://github.com/tc39/ecma402/pull/347#issuecomment-515874110:
I've filed the following two ICU bug reports:
Updated•6 years ago
|
As of today with Firefox 81.0 (64 bits) for Windows: fractionalSecondDigits option of Intl.DateTimeFormat does not work.
On console:
D = new Date(Date.UTC(2020,8,15,12,15,30,550));
F = new Intl.DateTimeFormat("en-GB",{second : "numeric", fractionalSecondDigits : "3"});
F.format(D); // => 30, should be 30.550
The very same sequence works on MS Edge and Chrome.
Comment 7•4 years ago
|
||
It's enabled in nightly builds only right now. Bug 1645107 will enable it in shipping builds.
Description
•