Showing age at death instead of age from birth on actor tiles.

This commit is contained in:
2025-02-23 17:11:47 +01:00
parent 48331c1c5a
commit 49f1bc9ce2
3 changed files with 21 additions and 3 deletions

View File

@@ -74,6 +74,9 @@ export function curateActor(actor, context = {}) {
ageFromBirth: actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
? differenceInYears(Date.now(), actor.date_of_birth)
: null,
ageAtDeath: actor.date_of_birth && actor.date_of_death && actor.date_of_birth.getFullYear() > 1
? differenceInYears(actor.date_of_death, 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,