feat: Localized dates and times

This commit is contained in:
Sharon Fox
2025-01-26 02:47:23 -05:00
parent 24ab79f5e9
commit dda945f4ad
11 changed files with 36 additions and 17 deletions
@@ -16,7 +16,9 @@
import Markdown from './Markdown.svelte';
import Name from './Name.svelte';
import Skeleton from './Skeleton.svelte';
import localizedFormat from 'dayjs/plugin/localizedFormat';
const i18n = getContext('i18n');
dayjs.extend(localizedFormat);
export let chatId;
export let history;
@@ -264,7 +266,7 @@
<span
class=" self-center invisible group-hover:visible text-gray-400 text-xs font-medium uppercase ml-0.5 -mt-0.5"
>
{dayjs(message.timestamp * 1000).format($i18n.t('h:mm a'))}
{dayjs(message.timestamp * 1000).format('LT')}
</span>
{/if}
</Name>