**var** todaysDate = **new** Date (). getFullYear (); // CURRENT YEAR
**let** inputDate = $w ( "#datePicker" ). value ; //VALUE FROM DATE PICKER
**var** inputDateyear = inputDate . getFullYear (); //YEAR PICKED FROM DATE PICKER
$w ( "#textElementID" ). show (); //SHOW TEXT AFTER PICKING A DATE (OPTIONAL)
$w ( "#textElementID" ). text = `Çocuğunuz " ${ String ( todaysDate - Number ( inputDateyear ))} " yaşında.` ; //DESIGN YOUR MESSAGE
})
})
this is my current code. When user selects a date, it will show “you are … years old.”
But i want to convert it to = “you are … years, … months, … days old.”
Nope, it still only says hey, you are for example 4 years old when i choose 2018. I want to convert it to = for example, “You are 4 years, 5 months and 20 days old”. I want to add month and days to it. Thanks for quick response!
Thanks for the reply. Actually i just need to take month and day from the date picker to show result as you are … years … months and … days old. Is there a couple code that i can add it? Thanks you again for having interest on this topic.