-2
I’m developing a freelance system for a college job and I’m having trouble calculating date.
I have a date field (for date selection) and another blocked label that will bring the result (age ) final, that is, from the date selected the system should make a calculation with the date of the system and bring me the age of the user
if this user is over 18, the registration will occur normally, if you are under 18, it will alert the prohibited use of the system
Can you help me
<!-- DATA AQUI -->
<div class="ui-g-12 ui-md-3">
<msp-input-date id="data-nascimento" label="Data de nascimento" tooltip="Ajustar"></msp-input-date>
</div>
<div class="ui-g-12 ui-md-3">
<msp-input-text id="idade" label="idade aqui" tooltip="teste"></msp-input-text>
</div>
<!-- END DATA -->
take a look at this question: https://stackoverflow.com/questions/4060004/calculate-age-given-the-birth-date-in-the-format-yymmdd
– Eduardo Vargas