person_renderbox fix if there is no birthdate

This commit is contained in:
Julie Lenaerts 2021-09-01 17:36:17 +02:00
parent 820def6294
commit 903d57ea9d

View File

@ -117,15 +117,19 @@ export default {
return this.person.gender == 'woman' ? 'fa-venus' : this.person.gender == 'man' ? 'fa-mars' : 'fa-neuter'; return this.person.gender == 'woman' ? 'fa-venus' : this.person.gender == 'man' ? 'fa-mars' : 'fa-neuter';
}, },
birthdate: function(){ birthdate: function(){
if(this.person.birthdate){ if(this.person.birthdate !== null){
const date = new Date(this.person.birthdate.datetime); const date = new Date(this.person.birthdate.datetime);
return dateToISO(date) return dateToISO(date)
} else {
return "";
} }
}, },
deathdate: function(){ deathdate: function(){
if(this.person.deathdate){ if(this.person.deathdate !== null){
const date = new Date(this.person.deathdate.datetime); const date = new Date(this.person.deathdate.datetime);
return date.toLocaleDateString("fr-FR"); return date.toLocaleDateString("fr-FR");
} else {
return "";
} }
}, },
altNameLabel: function(){ altNameLabel: function(){