Fixed age showing on actor tile when birth year is unknown.

This commit is contained in:
DebaucheryLibrarian 2024-12-29 02:16:57 +01:00
parent db8aeb97a7
commit 1cf789d8f7
1 changed files with 6 additions and 2 deletions

View File

@ -71,8 +71,12 @@ export function curateActor(actor, context = {}) {
name: actor.entity.name,
},
...Object.fromEntries(Object.entries(keyMap).map(([key, entryKey]) => [key, actor[entryKey]])),
ageFromBirth: actor.date_of_birth && differenceInYears(Date.now(), actor.date_of_birth),
ageThen: context.sceneDate && actor.date_of_birth && differenceInYears(context.sceneDate, actor.date_of_birth),
ageFromBirth: actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
? differenceInYears(Date.now(), actor.date_of_birth)
: null,
ageThen: context.sceneDate && actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
? differenceInYears(context.sceneDate, actor.date_of_birth)
: null,
bust: actor.bust,
cup: actor.cup,
waist: actor.waist,