UBERF-10248: Fix timezone loading (#8586)

* UBERF-10248: Fix local timezone

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* UBERF-10248: Remove unused import

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* UBERF-10248: Remove redundant arg

Signed-off-by: Artem Savchenko <armisav@gmail.com>

---------

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2025-04-16 20:30:05 +07:00
committed by GitHub
parent 45aaa26011
commit c370fdb1a8
13 changed files with 43 additions and 32 deletions
+2 -1
View File
@@ -111,6 +111,7 @@
"ViberPlaceholder": "Viber",
"UserProfile": "Uživatelský profil",
"DeactivatedAccount": "Deaktivovaný účet",
"LocalTime": "místní čas"
"LocalTime": "místní čas",
"LocalTimeNotSet": "Místní čas není nastaven"
}
}
+2 -1
View File
@@ -111,6 +111,7 @@
"ViberPlaceholder": "Viber",
"UserProfile": "Benutzerprofil",
"DeactivatedAccount": "Deaktivierter Account",
"LocalTime": "Ortszeit"
"LocalTime": "Ortszeit",
"LocalTimeNotSet": "Ortszeit nicht festgelegt"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "Confirmed",
"UserProfile": "User profile",
"DeactivatedAccount": "Deactivated account",
"LocalTime": "local time"
"LocalTime": "local time",
"LocalTimeNotSet": "Local time not set"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "Confirmado",
"UserProfile": "Perfil de usuario",
"DeactivatedAccount": "Cuenta desactivada",
"LocalTime": "hora local"
"LocalTime": "hora local",
"LocalTimeNotSet": "Hora local no establecida"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "Confirmé",
"UserProfile": "Profil utilisateur",
"DeactivatedAccount": "Compte désactivé",
"LocalTime": "heure locale"
"LocalTime": "heure locale",
"LocalTimeNotSet": "Heure locale non définie"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "Confermato",
"UserProfile": "Profilo utente",
"DeactivatedAccount": "Account disattivato",
"LocalTime": "ora locale"
"LocalTime": "ora locale",
"LocalTimeNotSet": "Ora locale non impostata"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "Confirmado",
"UserProfile": "Perfil do usuário",
"DeactivatedAccount": "Conta desativada",
"LocalTime": "hora local"
"LocalTime": "hora local",
"LocalTimeNotSet": "Hora local não definida"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "Подтвержден",
"UserProfile": "Профиль пользователя",
"DeactivatedAccount": "Деактивированный аккаунт",
"LocalTime": "местного времени"
"LocalTime": "местного времени",
"LocalTimeNotSet": "Местное время не задано"
}
}
+2 -1
View File
@@ -115,6 +115,7 @@
"Confirmed": "已确认",
"UserProfile": "用户资料",
"DeactivatedAccount": "已停用账户",
"LocalTime": "当地时间"
"LocalTime": "当地时间",
"LocalTimeNotSet": "未设置当地时间"
}
}
@@ -15,7 +15,7 @@
<script lang="ts">
import { Employee } from '@hcengineering/contact'
import { AccountUuid, Class, Doc, Ref } from '@hcengineering/core'
import { ButtonIcon, Loading, navigate } from '@hcengineering/ui'
import { ButtonIcon, navigate } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { getObjectLinkFragment } from '@hcengineering/view-resources'
import { ComponentExtensions, getClient } from '@hcengineering/presentation'
@@ -97,11 +97,7 @@
<div class="flex-col flex-gap-0-5">
<EmployeePresenter value={employee} shouldShowAvatar={false} showPopup={false} compact accent />
<span class="flex-presenter cursor-default">
{#if isTimezoneLoading}
<Loading size="small" />
{:else if timezone != null}
<TimePresenter {timezone} />
{/if}
<TimePresenter {timezone} {isTimezoneLoading} />
</span>
</div>
</div>
@@ -16,8 +16,10 @@
import { Icon, Label } from '@hcengineering/ui'
import contact from '@hcengineering/contact'
import view from '@hcengineering/view'
export let timezone: string
export let timezone: string | undefined
export let isTimezoneLoading: boolean
function displayTimeInTimezone (timezone: string): string {
const options: Intl.DateTimeFormatOptions = {
@@ -34,10 +36,16 @@
<div class="time-container">
<div class="clock-icon">
<Icon icon={contact.icon.Clock} size={'x-small'} />
<Icon icon={contact.icon.Clock} size={'smaller'} />
</div>
<div class="text-normal font-normal content-color select-text">
<span class="time-text-span">{displayTimeInTimezone(timezone)} <Label label={contact.string.LocalTime} /></span>
{#if isTimezoneLoading}
<span class="time-text-span"><Label label={view.string.Loading} /></span>
{:else if timezone != null}
<span class="time-text-span">{displayTimeInTimezone(timezone)} <Label label={contact.string.LocalTime} /></span>
{:else}
<span class="time-text-span"><Label label={contact.string.LocalTimeNotSet} /></span>
{/if}
</div>
</div>
+2 -1
View File
@@ -336,7 +336,8 @@ export const contactPlugin = plugin(contactId, {
Confirmed: '' as IntlString,
UserProfile: '' as IntlString,
DeactivatedAccount: '' as IntlString,
LocalTime: '' as IntlString
LocalTime: '' as IntlString,
LocalTimeNotSet: '' as IntlString
},
viewlet: {
TableMember: '' as Ref<Viewlet>,