@narendrayogi/how-old

Gets how old birthdate to a date.

Usage no npm install needed!

<script type="module">
  import narendrayogiHowOld from 'https://cdn.skypack.dev/@narendrayogi/how-old';
</script>

README

how-old gives how old from birthdate to any date. Not just previous dates from birthdate.

Examples

Example 1 - One day before birthday

new Date(2019, 1, 2), new Date(2020, 1, 1);
{ years: 0, months: 11, days: 30 }

Example 2 - On birthday

new Date(2019, 1, 2), new Date(2020, 1, 1);
{ years: 0, months: 11, days: 30 }

Example 3 - One day after birthday

new Date(2019, 1, 2), new Date(2020, 1, 1);
{ years: 0, months: 11, days: 30 }