JSFiddle - React, Tailwind, and code Playground
by ishanbakshi
HTML
<input type="text" id="age"></input>
JavaScript
value = "1994-05-23"//"10-10-1975"
today = new Date(),
dob = new Date(value.replace(/(\d{4})(\d{2})-(\d{2})/, "$3/$1/$2"));
age = today.getFullYear() - dob.getFullYear(); //This is the update
$('#age').val(age);