feat: ✨ change date of birth and include calculated age
This commit is contained in:
parent
46d7a89126
commit
3c7723c96a
1 changed files with 5 additions and 3 deletions
|
@ -4,7 +4,7 @@ export default {
|
||||||
firstName: "Sebin",
|
firstName: "Sebin",
|
||||||
middleName: "Antario",
|
middleName: "Antario",
|
||||||
lastName: "Nyshkim",
|
lastName: "Nyshkim",
|
||||||
dateOfBirth: new Date("1988-04-25"),
|
dateOfBirth: new Date("1993-10-17"),
|
||||||
gender: "male ♂️",
|
gender: "male ♂️",
|
||||||
height: 210, // cm
|
height: 210, // cm
|
||||||
weight: 124, // kg
|
weight: 124, // kg
|
||||||
|
@ -38,12 +38,14 @@ export default {
|
||||||
},
|
},
|
||||||
birthdate() {
|
birthdate() {
|
||||||
const locale = this.getClientLocale();
|
const locale = this.getClientLocale();
|
||||||
|
const age = this.getAge(this.dateOfBirth);
|
||||||
return this.dateOfBirth.toLocaleDateString(locale, {
|
const dobLocaleString = this.dateOfBirth.toLocaleDateString(locale, {
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "2-digit"
|
day: "2-digit"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return `${dobLocaleString} (${age})`;
|
||||||
},
|
},
|
||||||
getSebinData() {
|
getSebinData() {
|
||||||
const generic = {
|
const generic = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue