From 3a7dd4d6ebb40c39a98a6d7b6536e5b90b8e72e0 Mon Sep 17 00:00:00 2001 From: Mariano Mejia Date: Tue, 10 Nov 2026 16:06:24 +0800 Subject: [PATCH] Disallow illegal 'timeZone' option in Temporal.ZonedDateTime.prototype.toLocaleString (#64227) --- tsc/internal/bundled/libs/lib.esnext.temporal.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tsc/internal/bundled/libs/lib.esnext.temporal.d.ts b/tsc/internal/bundled/libs/lib.esnext.temporal.d.ts index 5f1293f455333..84af97f9cb8e7 100644 --- a/tsc/internal/bundled/libs/lib.esnext.temporal.d.ts +++ b/tsc/internal/bundled/libs/lib.esnext.temporal.d.ts @@ -271,6 +271,8 @@ declare namespace Temporal { timeZoneName?: "auto" | "never" | "critical" | undefined; } + interface ZonedDateTimeToLocaleStringOptions extends Omit {} + interface ZonedDateTimeFromOptions extends OverflowOptions, DisambiguationOptions { offset?: "use" | "ignore" | "prefer" | "reject" | undefined; } @@ -316,7 +318,7 @@ declare namespace Temporal { round(roundTo: RoundingOptions<"day" | TimeUnit>): ZonedDateTime; equals(other: ZonedDateTimeLike): boolean; toString(options?: ZonedDateTimeToStringOptions): string; - toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; + toLocaleString(locales?: Intl.LocalesArgument, options?: ZonedDateTimeToLocaleStringOptions): string; toJSON(): string; valueOf(): never; startOfDay(): ZonedDateTime;