feat: change date of birth and include calculated age

This commit is contained in:
Sebin Nyshkim 2020-12-27 01:10:52 +01:00
parent 46d7a89126
commit 3c7723c96a

View file

@ -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 = {