mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: format date and time in /admin/users/ -> Profile section (#20811)
Matches the format used in the user settings page. Added a formatting function in utils.
This commit is contained in:
parent
24db881c14
commit
5d2777a5c6
3 changed files with 49 additions and 18 deletions
|
|
@ -12,7 +12,7 @@
|
|||
playVideoThumbnailOnHover,
|
||||
showDeleteModal,
|
||||
} from '$lib/stores/preferences.store';
|
||||
import { findLocale } from '$lib/utils';
|
||||
import { createDateFormatter, findLocale } from '$lib/utils';
|
||||
import { onMount } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
|
@ -48,21 +48,7 @@
|
|||
}
|
||||
};
|
||||
let editedLocale = $derived(findLocale($locale).code);
|
||||
let formattedDate = $derived(
|
||||
time.toLocaleString(editedLocale, {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
}),
|
||||
);
|
||||
let timePortion = $derived(
|
||||
time.toLocaleString(editedLocale, {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
}),
|
||||
);
|
||||
let selectedDate = $derived(`${formattedDate} ${timePortion}`);
|
||||
let selectedDate: string = $derived(createDateFormatter(editedLocale).formatDateTime(time));
|
||||
let selectedOption = $derived({
|
||||
value: findLocale(editedLocale).code || fallbackLocale.code,
|
||||
label: findLocale(editedLocale).name || fallbackLocale.name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue