mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(web): format dates with the locale preference (#18259)
fix: Format dates in settings according to user setting
This commit is contained in:
parent
28d8357cc5
commit
1219fd82a0
3 changed files with 15 additions and 9 deletions
|
|
@ -18,6 +18,7 @@
|
|||
import { fade } from 'svelte/transition';
|
||||
import { handleError } from '../../utils/handle-error';
|
||||
import { notificationController, NotificationType } from '../shared-components/notification/notification';
|
||||
import { dateFormats } from '$lib/constants';
|
||||
|
||||
interface Props {
|
||||
keys: ApiKeyResponseDto[];
|
||||
|
|
@ -25,12 +26,6 @@
|
|||
|
||||
let { keys = $bindable() }: Props = $props();
|
||||
|
||||
const format: Intl.DateTimeFormatOptions = {
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
year: 'numeric',
|
||||
};
|
||||
|
||||
async function refreshKeys() {
|
||||
keys = await getApiKeys();
|
||||
}
|
||||
|
|
@ -130,7 +125,7 @@
|
|||
>
|
||||
<td class="w-1/3 text-ellipsis px-4 text-sm">{key.name}</td>
|
||||
<td class="w-1/3 text-ellipsis px-4 text-sm"
|
||||
>{new Date(key.createdAt).toLocaleDateString($locale, format)}
|
||||
>{new Date(key.createdAt).toLocaleDateString($locale, dateFormats.settings)}
|
||||
</td>
|
||||
<td class="flex flex-row flex-wrap justify-center gap-x-2 gap-y-1 w-1/3">
|
||||
<CircleIconButton
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue