-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[i18n] Intl getCanonicalLocales / RelativeTimeFormat / ListFormat > 2339 error #29129
Comments
Same thing with Code
Expected behavior: Actual behavior: |
Same thing with Code
Expected behavior: Actual behavior: |
How can I extend the Intl object in a types.d.ts file ? |
Drafts are not included into libs. You can declare a declare namespace Intl {
function getCanonicalLocales(locales: string | string[]): string[];
class RelativeTimeFormat {
constructor(locale: string);
// TODO Add other properties/methods
}
// const RelativeTimeFormat: any; // Use this instead of the class if you don't want to declare all properties/methods
class ListFormat {
constructor(locale: string);
// TODO Add other properties/methods
}
// const ListFormat: any; // Use this instead of the class if you don't want to declare all properties/methods
} |
Thank you ! Administrators will close this issue when the features are definitively implemented. |
Is there any update on this? RelativeDateTime should is now more than a draft: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat |
It’s not stage 4 yet
…On Fri, Oct 25, 2019 at 4:17 AM Dassderdie ***@***.***> wrote:
Is there any update on this? RelativeDateTime should is now more than a
draft:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#29129?email_source=notifications&email_token=AABQM35CH6K24OI4KGMPTDTQQKTPZA5CNFSM4GL6RF22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECHSK5Y#issuecomment-546252151>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABQM3356XD2WN3VEOYKKD3QQKTPZANCNFSM4GL6RF2Q>
.
|
* feat(lib/es2020.intl): Add `Intl.RelativeTimeFormat` (part of #29129); * fix(lib/es2020.intl): fix for tests and linters `Intl.RelativeTimeFormat` (part of #29129); * feat(lib/es2020.intl): Add TSDoc for `Intl.RelativeTimeFormat` by review request #36084 (comment); * fix(lib/es2020.intl): Fix for tests; Co-authored-by: Dmitry Makhnev <[email protected]>
Has Intl.ListFormat been added for support? |
It is now stage 4. |
One of the polyfills for
#39662 is pending for |
I tried adding the target as |
Try adding esnext & upgrade to 4.7 |
What's the deal with this? |
Everything appears to be updated and available in one of the compiler lib.d.ts versions such as ES2020.Intl... except for |
Any update on it? |
I see this is merged, what version can we expect this in? It doesn't seem to be in 5.3.2 using this config |
Must have been after the 5.3 cutoff, because it's only in |
TypeScript Version: 3.2.2
Search Terms:
Intl.getCanonicalLocales TS TypeScript Error 2339 undefined i18n
Code
Expected behavior:
Code works, and returns ["en-US"]
https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Intl/getCanonicalLocales
Actual behavior:
TS Error 2339, the property getCanonicalLocales does not exists on Intl
The text was updated successfully, but these errors were encountered: