-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Intl.ResolvedDateTimeFormatOptions is missing properties #45420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
This issue looks to be more thorough than #42577 - which does not mention the #42577 has been marked as a duplicate of #35865 / #34399. In both cases that appears to be an incorrect diagnosis, as both of those issues are about improvements to
|
Yes, you are correct. Read by diagonal and missed that Also looks like it's tricky question in which file definitions should go as #42945 tries to "move" (in that case just removing) some of this properties of |
* Import of Intl.Locale from #39664 * Handle updating es2020.intl and add es2021 for new DateTimeFormatOptions options - re: #39664 * Extends DateTimeFormatOptions for new Intl APIs - re: #45420 * Handle migrating Intl.NumberFormat.formatToParts to es2018 (keeping esnext.intl around) * Adds Intl.DisplayNames to es2020 - re: #44022 * Remove attributes added in es2021 from es2020 - re: #42944 * Add a reference to es2021 in the command line parser * Adds some docs about the lib files * Baselines * Allow undefined in Intl inputs to allow for ergonomic usage of exactOptionalPropertyTypes - see #45652 * Adds some tests covering the APIs * Apply suggestions from code review Co-authored-by: Nathan Shively-Sanders <[email protected]> * Handle PR feedback * More review improvements Co-authored-by: Nathan Shively-Sanders <[email protected]>
I'm reasonably sure I've got all these covered and merged into main with in #45647 - should be available in 4.5 |
Heya @orta, I'm not sure if I'm reading that PR correctly but it looks like |
Ping @orta, I've just tried on the nightly build playground and it still raises type errors. I don't think this issue has been resolved as the types of |
Yep, I agree 👍🏻 |
Thanks @orta <3 |
lib Update Request
Configuration Check
My compilation target is
ES2020
and my lib isthe default
.Missing / Incorrect Definition
Intl.ResolvedDateTimeFormatOptions
- the type returned by callingDateTimeFormat
'sresolvedOptions
method - appears to be missing the following properties:dateStyle
timeStyle
dayPeriod
hourCycle
fractionalSecondDigits
It looks like these items (along with
calendar
andnumberingSystem
) were added toes2020.intl.d.ts
'sDateTimeFormatOptions
however they were never added toResolvedDateTimeFormatOptions
.It seems that
calendar
andnumberingSystem
are both present ines5.d.ts
'sResolvedDateTimeFormatOptions
. Because of this I am unsure if the absent options should be added toResolvedDateTimeFormatOptions
in es5.d.ts or es2020.d.ts.https://tc39.es/ecma402/#table-datetimeformat-resolvedoptions-properties is the spec table of possible returned properties
Sample Code
Sample TS playground
The above lines throw type errors saying the various properies on
resolvedOptions
do not existDocumentation Link
https://tc39.es/ecma402/#table-datetimeformat-resolvedoptions-properties
The text was updated successfully, but these errors were encountered: