Calculating Age from Date of Birth (Native Mobile)

0
Hi All, I am using Mendix 8.4.1 (Native Mobile View). How can we calculate age from date of birth. Thanks, 
asked
2 answers
3
Try a javascript action:

/**
 * @param {Date} dateOfBirth
 * @returns {Promise.<Big>}
 */
export async function GetAgeFromDateOfBirth(dateOfBirth) {
	// BEGIN USER CODE
	const currentYear = new Date().getFullYear();
	const yearOfBirth = dateOfBirth.getFullYear();
	return currentYear - yearOfBirth;
	// END USER CODE
}

answered
0

you can find it here https://forum.mendix.com/link/questions/1096

also there is a yearsbetween java action in the community commons

answered