Form Calculation: How to add number of years instead of days in a date?

  • Profile Image
    commercialandlegal
    Asked on October 29, 2014 at 01:18 AM
  • Profile Image
    ashwin_d
    Answered on October 29, 2014 at 08:43 AM

    Hello commercialandlegal,

    The only function available to do the data calculation available in "Form Calculation" widget is "dateSrting()" where you can only add number of days. Unfortunately, within the form calculation widget, it is not possible to add number of years. You can calculate the number of days and then add 365 days to the date field to increase it by one year. 

    If you want to add the number of years in your expiry date, the only possibility I can think of is to download your form's full source code and add custom JavaScript to achieve your requirement. 

    If you google, you will get a lot of JavaScripts code to achieve your requirement. 

    Thank you!