mirror of
https://github.com/immich-app/immich.git
synced 2025-04-08 03:01:32 -05:00
feat(web): show birthdate on person page (#16772)
* feat(web): show birthdate on person page * shorten null check Co-authored-by: Jason Rasmussen <jason@rasm.me> * directly use birthDate --------- Co-authored-by: Jason Rasmussen <jason@rasm.me> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
57272904d6
commit
f794c3e0df
2 changed files with 21 additions and 2 deletions
|
@ -987,6 +987,7 @@
|
|||
"permanently_deleted_asset": "Permanently deleted asset",
|
||||
"permanently_deleted_assets_count": "Permanently deleted {count, plural, one {# asset} other {# assets}}",
|
||||
"person": "Person",
|
||||
"person_birthdate": "Born on {date}",
|
||||
"person_hidden": "{name}{hidden, select, true { (hidden)} other {}}",
|
||||
"photo_shared_all_users": "Looks like you shared your photos with all users or you don't have any user to share with.",
|
||||
"photos": "Photos",
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
import { onDestroy, onMount } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
import type { PageData } from './$types';
|
||||
import { locale } from '$lib/stores/preferences.store';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
interface Props {
|
||||
data: PageData;
|
||||
|
@ -539,12 +541,28 @@
|
|||
heightStyle="3.375rem"
|
||||
/>
|
||||
<div
|
||||
class="flex flex-col justify-center text-left px-4 h-14 text-immich-primary dark:text-immich-dark-primary"
|
||||
class="flex flex-col justify-center text-left px-4 text-immich-primary dark:text-immich-dark-primary"
|
||||
>
|
||||
<p class="w-40 sm:w-72 font-medium truncate">{person.name || $t('add_a_name')}</p>
|
||||
<p class="absolute w-fit text-sm text-gray-500 dark:text-immich-gray bottom-0">
|
||||
<p class="text-sm text-gray-500 dark:text-immich-gray">
|
||||
{$t('assets_count', { values: { count: numberOfAssets } })}
|
||||
</p>
|
||||
{#if person.birthDate}
|
||||
<p class="text-sm text-gray-500 dark:text-immich-gray">
|
||||
{$t('person_birthdate', {
|
||||
values: {
|
||||
date: DateTime.fromISO(person.birthDate).toLocaleString(
|
||||
{
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
year: 'numeric',
|
||||
},
|
||||
{ locale: $locale },
|
||||
),
|
||||
},
|
||||
})}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue