replied on September 27, 2016
Hi Jorge,
On the latest version of Forms, you actually don't need to use JavaScript; you can apply this calculation:
=DATEDIF(Depart_Date,Return_Date,"D") * Per_Diem
The DATEDIF function takes three arguments, in order:
- Start date of the time period
- End date of the time period
- Unit to calculate; in this case "D" for days.
You can read more from the OpenFormula specifications for DATEDIF.
Note that in the above, I've assumed names for the field variables and that the three fields are separate; if they are included in table, e.g. you would have to modify the variable references accordingly.
Hope this helps!