Question: how to calculate my age in years months and days in javascript?
Answer: Calculate the age using a text field var a = moment(); var b = moment('{dem_pat_birthyear}', 'MM-YYYY'); var age = moment. duration(a. diff(b)); var years = age. years(); var months = age.