Closed Bug 1569927 Opened 5 years ago Closed 5 years ago

Fractional seconds part name is "fractionalSecond" instead of "fractionalSecondDigits"

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
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.

Blocks: 1570011

Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/52b026aec218
Use correct name for fractional second parts record. r=jwalden

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

Just documenting this for FF84 release. How is fractionalSecondDigits rounded, if necessary - just to nearest integer?

Flags: needinfo?(andrebargull)

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.

Flags: needinfo?(andrebargull)

Thanks André!
FYI,

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 :-)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: