diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index aa6905a4d6..334b406bb0 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -258,62 +258,58 @@
{person.name}
- {#if person.birthDate} - {@const personBirthDate = DateTime.fromISO(person.birthDate)} - {@const age = Math.floor(DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'years').years)} - {@const ageInMonths = Math.floor( - DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'months').months, - )} - {#if age >= 0} -- {#if ageInMonths <= 11} - Age {ageInMonths} months - {:else} - Age {age} - {/if} -
- {/if} +{person.name}
+ {#if person.birthDate} + {@const personBirthDate = DateTime.fromISO(person.birthDate)} + {@const age = Math.floor(DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'years').years)} + {@const ageInMonths = Math.floor( + DateTime.fromISO(asset.fileCreatedAt).diff(personBirthDate, 'months').months, + )} + {#if age >= 0} ++ {#if ageInMonths <= 11} + Age {ageInMonths} months + {:else} + Age {age} + {/if} +
{/if} - -