How to automatically add and calculate age (in months) based on the Birthdate and Date of Weighing Picker?

your php script is already doing it…
or do you like to translate that php code into blocks?
in case of yes, then a good starting point is this guide

Taifun