diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index 9c28c9fdb..593d76f7d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -77,6 +77,7 @@ const messages = { man: "Né le", woman: "Née le" }, + deathdate: "Date de décès", years_old: "ans", no_data: "Aucune information renseignée", type: { 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 0a8a8da9f..f886a3d29 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -28,12 +28,16 @@

+ {{ person.deathdate }} -

@@ -100,7 +104,7 @@ export default { }, props: ['person', 'options'], computed: { - getGender: function() { + getGenderTranslation: function() { return this.person.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man'; }, isMultiline: function() { @@ -138,6 +142,17 @@ export default { const birthday = new Date(this.person.birthdate.datetime) const now = new Date() return (now.getFullYear() - birthday.getFullYear()) + } else if(this.person.birthdate && this.person.deathdate){ + const birthday = new Date(this.person.birthdate.datetime) + const deathdate = new Date(this.person.deathdate.datetime) + return (deathdate.getFullYear() - birthday.getFullYear()) + } else if(!this.person.birthdate && this.person.deathdate.datetime) { + // todo: change this + return "Age unknown" + } else { + // todo: change this + return "Age unknown" + } } } }