Simple function for calculate the age of a person from a date. This package can calculate the age in years, months and days.
npm install calc-age
const calcAge =const date = year: 1989 month: 3 day: 9const myAge =console // Should be equal to 28 (current year: 2017).
This function also accept an string as number, the following object is valid:
const date = year: '1989' month: '3' day: '9'
If you use an string as number, the string always should be only one or more digits.