Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Hi Adrian
If you want to do this before saving the form, I guess you mean before submitting it so the user can see the duration straight away, and that means using JavaScript.
I suggest you use the browser dev tools to examine the form date fields as you update them.
You should see that the actual fields for the dates are hidden fields. The visible datepicker fields are "fake" fields which, when completed, trigger some JS that calculates the UNIX timestamp from the inputted date and adds this to the hidden field.
So, you can add some JS that is triggered by the second date field losing focus which takes the timestamp values from the hidden fields and subtracts them to get the duration, then use the Date function and getFullYear method to convert the difference to years to store in another field.