Adds more Intl.ResolvedDateTimeFormatOptions, and hooks up Intl for ES2021 (#45905)

* Adds more ResolvedDateTimeFormatOptions to the Intl APIs

* Fix tests
This commit is contained in:
Orta Therox
2021-09-23 21:33:37 +01:00
committed by GitHub
parent a4f9bf0fce
commit 61d2939359
3 changed files with 16 additions and 6 deletions

1
src/lib/es2021.d.ts vendored
View File

@@ -2,3 +2,4 @@
/// <reference lib="es2021.promise" />
/// <reference lib="es2021.string" />
/// <reference lib="es2021.weakref" />
/// <reference lib="es2021.intl" />

View File

@@ -8,6 +8,15 @@ declare namespace Intl {
fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined;
}
interface ResolvedDateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit";
dateStyle?: "full" | "long" | "medium" | "short";
timeStyle?: "full" | "long" | "medium" | "short";
hourCycle?: "h11" | "h12" | "h23" | "h24";
dayPeriod?: "narrow" | "short" | "long";
fractionalSecondDigits?: 0 | 1 | 2 | 3;
}
interface NumberFormat {
formatRange(startDate: number | bigint, endDate: number | bigint): string;
formatRangeToParts(startDate: number | bigint, endDate: number | bigint): NumberFormatPart[];