Fractional seconds part name is "fractionalSecond" instead of "fractionalSecondDigits"
Categories
(Core :: JavaScript: Internationalization API, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(1 file)
js> new Intl.DateTimeFormat("en", {fractionalSecondDigits: 1}).formatToParts(0)
should return [{type:"fractionalSecond", value:"4"}]
, but currently returns [{type:"fractionalSecondDigits", value:"4"}]
.
This is tested in https://github.com/tc39/test262/blob/master/test/intl402/DateTimeFormat/prototype/formatToParts/fractionalSecondDigits.js.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9d1cc02db6a331159017f2839ab124774013643e
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/52b026aec218
Use correct name for fractional second parts record. r=jwalden
Comment 4•5 years ago
|
||
bugherder |
Comment 5•4 years ago
|
||
Just documenting this for FF84 release. How is fractionalSecondDigits rounded, if necessary - just to nearest integer?
Assignee | ||
Comment 6•4 years ago
|
||
The value is truncated. Or more specifically, the value is checked to be in the range [1, 3] and then it is floored: https://tc39.es/ecma402/#sec-defaultnumberoption.
Comment 7•4 years ago
|
||
Thanks André!
FYI,
- This option has been added to Intl.DateTimeFormat() constructor > Syntax for FF84.
- Other docs actions are captured in the docs issue
Comment 8•4 years ago
|
||
PS Ignore that, I already "FYId" you in https://bugzilla.mozilla.org/show_bug.cgi?id=1645107#c6. Any discussion that might be needed we can carry on there :-)
Description
•