From 903d57ea9dfc1b349dda7cdd9b62fb48b7a43bee Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 1 Sep 2021 17:36:17 +0200 Subject: [PATCH] person_renderbox fix if there is no birthdate --- .../public/vuejs/_components/Entity/PersonRenderBox.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue index 82948a37a..38039501d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -117,15 +117,19 @@ export default { return this.person.gender == 'woman' ? 'fa-venus' : this.person.gender == 'man' ? 'fa-mars' : 'fa-neuter'; }, birthdate: function(){ - if(this.person.birthdate){ + if(this.person.birthdate !== null){ const date = new Date(this.person.birthdate.datetime); return dateToISO(date) + } else { + return ""; } }, deathdate: function(){ - if(this.person.deathdate){ + if(this.person.deathdate !== null){ const date = new Date(this.person.deathdate.datetime); return date.toLocaleDateString("fr-FR"); + } else { + return ""; } }, altNameLabel: function(){