Skip to content

Commit bce412c

Browse files
authored
fix(40806): Add missing options and possible values of DateTimeFormat (microsoft#41880)
1 parent a2ddfcf commit bce412c

File tree

2 files changed

+42
-12
lines changed

2 files changed

+42
-12
lines changed

src/lib/es2020.intl.d.ts

+23
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,27 @@ declare namespace Intl {
277277
unit?: string;
278278
unitDisplay?: string;
279279
}
280+
281+
interface DateTimeFormatOptions {
282+
dateStyle?: "full" | "long" | "medium" | "short";
283+
timeStyle?: "full" | "long" | "medium" | "short";
284+
calendar?: "buddhist" | "chinese" | " coptic" | "ethiopia" | "ethiopic" | "gregory" | " hebrew" | "indian" | "islamic" | "iso8601" | " japanese" | "persian" | "roc";
285+
dayPeriod?: "narrow" | "short" | " long";
286+
numberingSystem?: "arab" | "arabext" | " bali" | "beng" | "deva" | "fullwide" | " gujr" | "guru" | "hanidec" | "khmr" | " knda" | "laoo" | "latn" | "limb" | "mlym" | " mong" | "mymr" | "orya" | "tamldec" | " telu" | "thai" | "tibt";
287+
localeMatcher?: "best fit" | "lookup";
288+
timeZone?: string;
289+
hour12?: boolean;
290+
hourCycle?: "h11" | "h12" | "h23" | "h24";
291+
formatMatcher?: "best fit" | "basic";
292+
weekday?: "long" | "short" | "narrow";
293+
era?: "long" | "short" | "narrow";
294+
year?: "numeric" | "2-digit";
295+
month?: "numeric" | "2-digit" | "long" | "short" | "narrow";
296+
day?: "numeric" | "2-digit";
297+
hour?: "numeric" | "2-digit";
298+
minute?: "numeric" | "2-digit";
299+
second?: "numeric" | "2-digit";
300+
fractionalSecondDigits?: 0 | 1 | 2 | 3;
301+
timeZoneName?: "long" | "short";
302+
}
280303
}

tests/lib/lib.d.ts

+19-12
Original file line numberDiff line numberDiff line change
@@ -3938,19 +3938,26 @@ declare module Intl {
39383938
}
39393939

39403940
interface DateTimeFormatOptions {
3941-
localeMatcher?: string;
3942-
weekday?: string;
3943-
era?: string;
3944-
year?: string;
3945-
month?: string;
3946-
day?: string;
3947-
hour?: string;
3948-
minute?: string;
3949-
second?: string;
3950-
timeZoneName?: string;
3951-
formatMatcher?: string;
3952-
hour12?: boolean;
3941+
dateStyle?: "full" | "long" | "medium" | "short";
3942+
timeStyle?: "full" | "long" | "medium" | "short";
3943+
calendar?: "buddhist" | "chinese" | " coptic" | "ethiopia" | "ethiopic" | "gregory" | " hebrew" | "indian" | "islamic" | "iso8601" | " japanese" | "persian" | "roc";
3944+
dayPeriod?: "narrow" | "short" | " long";
3945+
numberingSystem?: "arab" | "arabext" | " bali" | "beng" | "deva" | "fullwide" | " gujr" | "guru" | "hanidec" | "khmr" | " knda" | "laoo" | "latn" | "limb" | "mlym" | " mong" | "mymr" | "orya" | "tamldec" | " telu" | "thai" | "tibt";
3946+
localeMatcher?: "best fit" | "lookup";
39533947
timeZone?: string;
3948+
hour12?: boolean;
3949+
hourCycle?: "h11" | "h12" | "h23" | "h24";
3950+
formatMatcher?: "best fit" | "basic";
3951+
weekday?: "long" | "short" | "narrow";
3952+
era?: "long" | "short" | "narrow";
3953+
year?: "numeric" | "2-digit";
3954+
month?: "numeric" | "2-digit" |"long" | "short" | "narrow";
3955+
day?: "numeric" | "2-digit";
3956+
hour?: "numeric" | "2-digit";
3957+
minute?: "numeric" | "2-digit";
3958+
second?: "numeric" | "2-digit";
3959+
fractionalSecondDigits?: 0 | 1 | 2 | 3;
3960+
timeZoneName?: "long" | "short";
39543961
}
39553962

39563963
interface ResolvedDateTimeFormatOptions {

0 commit comments

Comments
 (0)