further adaptations to display deathdate. deathdate added to what API returns

This commit is contained in:
2021-08-26 16:42:33 +02:00
parent 5194cad354
commit c5f40c53ea
4 changed files with 72 additions and 79 deletions

View File

@@ -28,7 +28,6 @@
</div>
<p v-if="options.addInfo == true" class="moreinfo">
{{ person.deathdate }}
<i :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
<time v-if="person.birthdate && !person.deathdate" datetime="{{ person.birthdate }}" title="{{ birthdate }}">
{{ $t(getGenderTranslation) + ' ' + $d(birthdate, 'text') }}
@@ -39,7 +38,7 @@
<time v-else-if="person.deathdate" datetime="{{ person.deathdate }}" title="{{ person.deathdate }}">
{{ $t('renderbox.deathdate') + ' ' + deathdate }}
</time>
<span v-if="options.addAge" class="age">{{ getAge }} {{ $t('renderbox.years_old')}}</span>
<span v-if="options.addAge && person.birthdate" class="age">{{ getAge }} {{ $t('renderbox.years_old')}}</span>
</p>
</div>
</div>
@@ -118,13 +117,15 @@ export default {
return this.person.gender == 'woman' ? 'fa-venus' : this.person.gender == 'man' ? 'fa-mars' : 'fa-neuter';
},
birthdate: function(){
if(this.person.birthdate){
const date = new Date(this.person.birthdate.datetime);
return dateToISO(date);
return dateToISO(date)
}
},
deathdate: function(){
if(this.person.deathdate){
const date = new Date(this.person.deathdate.datetime);
return dateToISO(date);
return date.toLocaleDateString("fr-FR");
}
},
altNameLabel: function(){