Repository navigation
fix(40806): Add missing options and possible values of DateTimeFormat - #41880
Orta Therox (orta) merged 1 commit into
Conversation
|
It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'. |
581b896 to
afe9619
Compare
afe9619 to
5790472
Compare
|
Sorry to bother you Orta Therox (@orta), I just created a similar PR as #40906 but with all the options I found on MDN page. |
|
Alright, this looks good to me - thanks 👍🏻 |
|
I am seeing some problems compiling TypeScript code with this change. I believe the issue is that the types in // ES5:
interface DateTimeFormatOptions {
localeMatcher?: string;
weekday?: string;
era?: string;
year?: string;
month?: string;
day?: string;
hour?: string;
minute?: string;
second?: string;
timeZoneName?: string;
formatMatcher?: string;
hour12?: boolean;
timeZone?: string;
}
// ES2020:
interface DateTimeFormatOptions {
dateStyle?: "full" | "long" | "medium" | "short";
timeStyle?: "full" | "long" | "medium" | "short";
calendar?: "buddhist" | "chinese" | " coptic" | "ethiopia" | "ethiopic" | "gregory" | " hebrew" | "indian" | "islamic" | "iso8601" | " japanese" | "persian" | "roc";
dayPeriod?: "narrow" | "short" | " long";
numberingSystem?: "arab" | "arabext" | " bali" | "beng" | "deva" | "fullwide" | " gujr" | "guru" | "hanidec" | "khmr" | " knda" | "laoo" | "latn" | "limb" | "mlym" | " mong" | "mymr" | "orya" | "tamldec" | " telu" | "thai" | "tibt";
localeMatcher?: "best fit" | "lookup";
timeZone?: string;
hour12?: boolean;
hourCycle?: "h11" | "h12" | "h23" | "h24";
formatMatcher?: "best fit" | "basic";
weekday?: "long" | "short" | "narrow";
era?: "long" | "short" | "narrow";
year?: "numeric" | "2-digit";
month?: "numeric" | "2-digit" | "long" | "short" | "narrow";
day?: "numeric" | "2-digit";
hour?: "numeric" | "2-digit";
minute?: "numeric" | "2-digit";
second?: "numeric" | "2-digit";
fractionalSecondDigits?: 0 | 1 | 2 | 3;
timeZoneName?: "long" | "short";
}Fields like Also, several of the property values have leading spaces, e.g. |
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx typescript@4.2.1-rc -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error.
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx typescript@4.2.1-rc -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <mariusz.pawelski@crowdworx.com>
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx typescript@4.2.1-rc -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <mariusz.pawelski@crowdworx.com>
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx typescript@4.2.1-rc -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <mariusz.pawelski@crowdworx.com>
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx typescript@4.2.1-rc -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <mariusz.pawelski@crowdworx.com>
Fixes #40806
Options of Intl DateTimeFormat and possible values taken from MDN page Intl/DateTimeFormat.