Hello, I have no experience with Javascript which seems to be needed for this question.
I am wondering if it is possible to use just month and year of birth to estimate age eligibility (18-25 year olds). Obviously without the day of birth, it would not be precise, but I am looking to use just month and year of birth in order to exclude less than 18 or greater than 25 year olds.
I'm currently using a Javascript survey question from the global library that asks for month and year of birth.
I am wondering if it is possible to use just month and year of birth to estimate age eligibility (18-25 year olds). Obviously without the day of birth, it would not be precise, but I am looking to use just month and year of birth in order to exclude less than 18 or greater than 25 year olds.
I'm currently using a Javascript survey question from the global library that asks for month and year of birth.
Page 1 / 1
Hi there, if you still need, there are a couple of ways to calculate an exact age using JavaScript. There are several posts around the community on how this might be done, like here and here.
However, for a rougher approximation of date differences using Month and Year, this can also be approached without JavaScript by using Math Operations in the Survey Flow to calculate a difference in days.
Your Survey Flow might be set up like the below, where RespondentMonth and RespondentYear are piped in from the collected date values in the survey.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.