Spaces:
Running
Running
export const calcAge = (dob: Date): number => { | |
const diff = Date.now() - dob.getTime(); | |
const ageDate = new Date(diff); | |
return Math.abs(ageDate.getUTCFullYear() - 1970); | |
} | |