Calculating the difference between two date fields in days
Update: For the calculation of the difference between two dates and other useful functions use Date Helper Utils Plugin.
The example shows after entering two date values the difference can be calculated in days.
Important: The date fields are initialised in the script, so the date fields have the data type text.
Enable JavaScript to see the sample code