Type definition for fractionalSecondDigits
in Intl.DateTimeFormatOptions has incorrect 0
.
#48912
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Good First Issue
Well scoped, documented and has the green light
Help Wanted
You can do this
lib update
PR modifies files in the `lib` folder
Milestone
lib Update Request
Configuration Check
My compilation target is
es2016
and my lib ises2021
.Missing / Incorrect Definition
fractionalSecondDigits
in Intl.DateTimeFormatOptions should not have0
.However current type definition is
fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined;
.https://github.com/microsoft/TypeScript/blob/v4.6.4/src/lib/es2021.intl.d.ts
Sample Code
This code throws RangeError on Chrome v101, Safari v15.4, Firefox v99 and Node.js v16,v17.
Documentation Link
fractionalSecondDigits
values are 1, 2 or 3 in ECMAScript® 2021 Internationalization API Specification.https://402.ecma-international.org/8.0/#sec-datetimeformat-abstracts
Related conversation at tc39/ecma402#590
The text was updated successfully, but these errors were encountered: