Fix timezone with _ display (#4793)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-02-28 01:17:23 +07:00 committed by GitHub
parent 1967e8e5dc
commit 77ac277596
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -138,8 +138,10 @@ export function getFormattedDate (value: number | null, options?: Intl.DateTimeF
return value === null ? '' : new Date(value).toLocaleString('default', options ?? { month: 'short', day: 'numeric' })
}
export const getTimeZoneName = (val: string = Intl.DateTimeFormat().resolvedOptions().timeZone): string => {
return val.split('/')[1] ?? ''
export const getTimeZoneName = (
val: string = Intl.DateTimeFormat().resolvedOptions().timeZoneName ?? Intl.DateTimeFormat().resolvedOptions().timeZone
): string => {
return val.replace('_', ' ').split('/')[1] ?? ''
}
export const convertTimeZone = (tz: string): TimeZone => {