Date Difference Widget: How to calculate age using the widget?

  • dpcrout
    Asked on September 20, 2016 at 5:46 PM

    Hi,

     

    I am trying to calculate a person's age based off the current date. I am using the Date Difference widget. I can put in the current date and the date of birth, but there is nowhere to display the results.

     

    I want to put in an Age field that will be the result of the date calculation, but I don't see how to do that.

     

    Thanks.....

  • Kevin Support Team Lead
    Replied on September 20, 2016 at 9:08 PM

    The widget will provide you the number of days between both dates, this value can be captured with the Form Calculation widget.

    First you need to set up the widget to give only the number of days as result: 

    Date Difference Widget: How to calculate age using the widget?  Image 1 Screenshot 60

    Then you need to add the Form Calculation widget to your form and include the Date Difference widget there, please add the calculation as shown in the screenshot below: 

    Date Difference Widget: How to calculate age using the widget?  Image 2 Screenshot 71

    Date Difference Widget: How to calculate age using the widget?  Image 3 Screenshot 82

    Here is also how the value is captured, without the calculation shown above: 

    Date Difference Widget: How to calculate age using the widget?  Image 4 Screenshot 93

    But calculating the result given by the widget you should be able to get the age: 

    Date Difference Widget: How to calculate age using the widget?  Image 5 Screenshot 104

    Here is also my sample form so you can take a look, feel free to clone it too: https://form.jotform.com/62637642098969.

    Hope this helps.