UBERF-5621: add full date tooltip (#4783)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-02-27 12:30:58 +04:00 committed by GitHub
parent 7875ca74ea
commit d8ab1316c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,8 +22,9 @@
import { Avatar, EmployeePresenter, SystemAvatar } from '@hcengineering/contact-resources' import { Avatar, EmployeePresenter, SystemAvatar } from '@hcengineering/contact-resources'
import core, { getDisplayTime } from '@hcengineering/core' import core, { getDisplayTime } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import { Action, Label } from '@hcengineering/ui' import { Action, Label, tooltip } from '@hcengineering/ui'
import { getActions, restrictionStore } from '@hcengineering/view-resources' import { getActions, restrictionStore } from '@hcengineering/view-resources'
import { getEmbeddedLabel } from '@hcengineering/platform'
import ReactionsPresenter from '../reactions/ReactionsPresenter.svelte' import ReactionsPresenter from '../reactions/ReactionsPresenter.svelte'
import ActivityMessageExtensionComponent from './ActivityMessageExtension.svelte' import ActivityMessageExtensionComponent from './ActivityMessageExtension.svelte'
@ -107,6 +108,14 @@
let readonly: boolean = false let readonly: boolean = false
$: readonly = $restrictionStore.disableComments $: readonly = $restrictionStore.disableComments
$: fullDate = new Date(message.createdOn ?? message.modifiedOn).toLocaleString('default', {
minute: '2-digit',
hour: 'numeric',
day: '2-digit',
month: 'short',
year: 'numeric'
})
</script> </script>
{#if !isHidden} {#if !isHidden}
@ -161,7 +170,14 @@
{#if !skipLabel} {#if !skipLabel}
<slot name="header" /> <slot name="header" />
{/if} {/if}
<span class="text-sm">{getDisplayTime(message.createdOn ?? 0)}</span> <span
class="text-sm"
use:tooltip={{
label: getEmbeddedLabel(fullDate)
}}
>
{getDisplayTime(message.createdOn ?? 0)}
</span>
</div> </div>
<slot name="content" /> <slot name="content" />