fix(web): Make date-time formatting follow locale (#17899)

* fixed missing $locale parameter to .toLocaleString

* Remove unused types and functions in timeline-util

* remove unused export

* re-enable export because it is needed for tests

* format
This commit is contained in:
Andreas Tollkötter 2025-04-28 15:53:26 +02:00 committed by GitHub
parent 205260d31c
commit 85ac0512a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 31 additions and 70 deletions

View file

@ -6,6 +6,7 @@
import { t } from 'svelte-i18n';
import { mdiAlert } from '@mdi/js';
import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store';
interface Props {
onClose: () => void;
@ -177,16 +178,19 @@
<span
class="immich-form-label pb-2 text-xs"
id="version-history"
title={createdAt.toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS)}
title={createdAt.toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS, { locale: $locale })}
>
{$t('version_history_item', {
values: {
version: item.version,
date: createdAt.toLocaleString({
month: 'short',
day: 'numeric',
year: 'numeric',
}),
date: createdAt.toLocaleString(
{
month: 'short',
day: 'numeric',
year: 'numeric',
},
{ locale: $locale },
),
},
})}
</span>