mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Adaptations for display of age and deathdate (different scenarios not all finished)
This commit is contained in:
parent
88362bd284
commit
5194cad354
@ -77,6 +77,7 @@ const messages = {
|
|||||||
man: "Né le",
|
man: "Né le",
|
||||||
woman: "Née le"
|
woman: "Née le"
|
||||||
},
|
},
|
||||||
|
deathdate: "Date de décès",
|
||||||
years_old: "ans",
|
years_old: "ans",
|
||||||
no_data: "Aucune information renseignée",
|
no_data: "Aucune information renseignée",
|
||||||
type: {
|
type: {
|
||||||
|
@ -28,12 +28,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p v-if="options.addInfo == true" class="moreinfo">
|
<p v-if="options.addInfo == true" class="moreinfo">
|
||||||
|
{{ person.deathdate }}
|
||||||
<i :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
|
<i :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
|
||||||
<time v-if="person.birthdate" datetime="{{ person.birthdate }}" title="{{ birthdate }}">
|
<time v-if="person.birthdate && !person.deathdate" datetime="{{ person.birthdate }}" title="{{ birthdate }}">
|
||||||
{{ $t(getGender) + ' ' + $d(birthdate, 'text') }}
|
{{ $t(getGenderTranslation) + ' ' + $d(birthdate, 'text') }}
|
||||||
|
</time>
|
||||||
|
<time v-else-if="person.birthdate && person.deathdate" datetime="{{ person.deathdate }}" title="{{ person.deathdate }}">
|
||||||
|
{{ birthdate }} - {{ deathdate }}
|
||||||
</time>
|
</time>
|
||||||
<time v-else-if="person.deathdate" datetime="{{ person.deathdate }}" title="{{ person.deathdate }}">
|
<time v-else-if="person.deathdate" datetime="{{ person.deathdate }}" title="{{ person.deathdate }}">
|
||||||
{{ birthdate }} - {{ deathdate }}
|
{{ $t('renderbox.deathdate') + ' ' + deathdate }}
|
||||||
</time>
|
</time>
|
||||||
<span v-if="options.addAge" class="age">{{ getAge }} {{ $t('renderbox.years_old')}}</span>
|
<span v-if="options.addAge" class="age">{{ getAge }} {{ $t('renderbox.years_old')}}</span>
|
||||||
</p>
|
</p>
|
||||||
@ -100,7 +104,7 @@ export default {
|
|||||||
},
|
},
|
||||||
props: ['person', 'options'],
|
props: ['person', 'options'],
|
||||||
computed: {
|
computed: {
|
||||||
getGender: function() {
|
getGenderTranslation: function() {
|
||||||
return this.person.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
|
return this.person.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
|
||||||
},
|
},
|
||||||
isMultiline: function() {
|
isMultiline: function() {
|
||||||
@ -138,6 +142,17 @@ export default {
|
|||||||
const birthday = new Date(this.person.birthdate.datetime)
|
const birthday = new Date(this.person.birthdate.datetime)
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
return (now.getFullYear() - birthday.getFullYear())
|
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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user