• Resolved majab44

    (@majab44)


    Hi

    I want to be able to calculate a persons age on a certain date. I’ve made the calculation, but I can only get it to show number of days in age. Can I change it so it says 3 months and 2 days or 3 years and 2 days for example?

    • This topic was modified 1 year, 5 months ago by majab44.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @majab44,

    Thank you very much for using our plugin. Yes that’s possible.

    For example, assuming the fieldname1 is a date field to allow users to select their birthdays, you only need to insert a calculated field in the form and enter the equation:

    
    (function(){
    let d = DATEDIFF(fieldname1, TODAY(), 'dd/mm/yyyy', 'y');
    return CONCATENATE( d['years'], ' years, ', d['months'], ' months and ', d['days'], ' days');
    })()

    Best regards.

    Thread Starter majab44

    (@majab44)

    Thank you! That worked

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Calculator age’ is closed to new replies.