Skip to content
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

Duration toLocaleString - wrong options parameter type #277

Open
jakobfdev opened this issue Mar 12, 2024 · 0 comments
Open

Duration toLocaleString - wrong options parameter type #277

jakobfdev opened this issue Mar 12, 2024 · 0 comments

Comments

@jakobfdev
Copy link

toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;

The toLocaleString function of Duration still has the Intl.DateTimeFormat type as second parameter. This should - according to spec - be the Intl.DurationFormat type.

Discussion about including the Duration formatting proposal has already started here
#211

Maybe include correct types already - while waiting for a more mature polyfill.

The formatjs polyfill has been developed quite a bit and probably comes with complete typing
see https://www.npmjs.com/package/@formatjs/intl-durationformat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant