You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intl.ResolvedDateTimeFormatOptions is missing properties #45420
My compilation target is ES2020 and my lib is the default.
Missing / Incorrect Definition
Intl.ResolvedDateTimeFormatOptions - the type returned by calling DateTimeFormat's resolvedOptions method - appears to be missing the following properties:
dateStyle
timeStyle
dayPeriod
hourCycle
fractionalSecondDigits
It looks like these items (along with calendar and numberingSystem) were added to es2020.intl.d.ts's DateTimeFormatOptions however they were never added to ResolvedDateTimeFormatOptions.
It seems that calendar and numberingSystem are both present in es5.d.ts's ResolvedDateTimeFormatOptions. Because of this I am unsure if the absent options should be added to ResolvedDateTimeFormatOptions in es5.d.ts or es2020.d.ts.
This issue looks to be more thorough than #42577 - which does not mention the dayPeriod or fractionalSecondDigits.
#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 DateTimeFormatOptions, NOT ResolvedDateTimeFormatOptions.
Yes, you are correct. Read by diagonal and missed that ResolvedDateTimeFormatOptions were not updated to match other options added to options.
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 DateTimeFormatOptions to further versions.
I'm not sure if I'm reading that PR correctly but it looks like DateTimeFormatOptions was updated but I can't see any adjustments to ResolvedDateTimeFormatOptions, or any places where the return interface of resolvedOptions() got changed to something else.
Activity
IllusionMH commentedon Aug 12, 2021
Duplicate of #42577 which itself is duplicate of other issues.Not a duplicate of linked issue
BPScott commentedon Aug 12, 2021
This issue looks to be more thorough than #42577 - which does not mention the
dayPeriodorfractionalSecondDigits.#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
DateTimeFormatOptions, NOTResolvedDateTimeFormatOptions.DateTimeFormatOptions, changing them fromstringto specific values. This issue has been fixed as of TS 4.2 as that interface now uses unions of strings for those values.hourCyclefromDateTimeFormatOptions. This issue has been fixed as of TS 4.2 when targeting es2020 per this interface.IllusionMH commentedon Aug 12, 2021
Yes, you are correct. Read by diagonal and missed that
ResolvedDateTimeFormatOptionswere not updated to match other options added to options.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
DateTimeFormatOptionsto further versions.Extends DateTimeFormatOptions for new Intl APIs - re: microsoft#45420
Intl 2021 Updates (#45647)
orta commentedon Sep 8, 2021
I'm reasonably sure I've got all these covered and merged into main with in #45647 - should be available in 4.5
BPScott commentedon Sep 8, 2021
Heya Orta Therox (@orta),
I'm not sure if I'm reading that PR correctly but it looks like
DateTimeFormatOptionswas updated but I can't see any adjustments toResolvedDateTimeFormatOptions, or any places where the return interface of resolvedOptions() got changed to something else.BPScott commentedon Sep 16, 2021
Ping Orta Therox (@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
ResolvedDateTimeFormatOptionsdon't seem to have been updatedorta commentedon Sep 16, 2021
Yep, I agree 👍🏻
BPScott commentedon Sep 23, 2021
Thanks Orta Therox (@orta) <3