diff --git a/js/src/filters/datetime.ts b/js/src/filters/datetime.ts index e5fdb2725..bdc14e7d3 100644 --- a/js/src/filters/datetime.ts +++ b/js/src/filters/datetime.ts @@ -56,7 +56,7 @@ const SHORT_TIME_FORMAT_OPTIONS: DateTimeFormatOptions = { function formatDateTimeString( value: string, - timeZone: string | undefined = undefined, + timeZone: string | null | undefined = undefined, showTime = true, dateFormat = "long" ): string { @@ -68,7 +68,7 @@ function formatDateTimeString( options = { ...options, ...(isLongFormat ? LONG_TIME_FORMAT_OPTIONS : SHORT_TIME_FORMAT_OPTIONS), - timeZone, + timeZone: timeZone || undefined, }; } const format = new Intl.DateTimeFormat(locale(), options);