mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
using serialized age instead of function + translation fix
This commit is contained in:
parent
6aa1e136b4
commit
0a26e7f326
@ -47,7 +47,7 @@
|
||||
{{ $t('renderbox.deathdate') + ' ' + deathdate }}
|
||||
</time>
|
||||
|
||||
<span v-if="options.addAge && person.birthdate" class="age">{{ getAge }} {{ $t('renderbox.years_old')}}</span>
|
||||
<span v-if="options.addAge && person.birthdate" class="age">{{ $tc('renderbox.years_old', person.age) }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -202,24 +202,24 @@ export default {
|
||||
getUrl: function() {
|
||||
return `/fr/person/${this.person.id}/general`;
|
||||
},
|
||||
getAge: function() {
|
||||
// TODO only one abstract function
|
||||
if(this.person.birthdate && !this.person.deathdate){
|
||||
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"
|
||||
}
|
||||
},
|
||||
// getAge: function() {
|
||||
// // TODO only one abstract function
|
||||
// if(this.person.birthdate && !this.person.deathdate){
|
||||
// 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"
|
||||
// }
|
||||
// },
|
||||
getCurrentHouseholdUrl: function() {
|
||||
let returnPath = this.returnPath ? `?returnPath=${this.returnPath}` : ``;
|
||||
return `/fr/person/household/${this.person.current_household_id}/summary${returnPath}`
|
||||
|
@ -21,7 +21,6 @@ export default {
|
||||
for(let i = 0; i < this.person.altNames.length; i++){
|
||||
return this.person.altNames[i].label
|
||||
}
|
||||
console.log(this.person.altNames)
|
||||
},
|
||||
altNameKey: function() {
|
||||
for(let i = 0; i < this.person.altNames.length; i++){
|
||||
|
Loading…
x
Reference in New Issue
Block a user