Do you need to calculate the number of days between two dates? Now this is something that is very easy and pleasant to do.
To get started, we are going to create a Form with two date fields (Check In and Check Out), a number field (Number of days) and a submit button. Your form should looks like this screenshot:
Now go to the Rule Builder (Forms > Actions > Conditional rules) and click “Add rule”.
1. Name: Calculate days between dates
2. Click “Add condition” > Check In is present
3. Click “Add condition” > Check Out is present
4. Click “Add action” > Evaluate
5. Formula: differenceInDays({{date_2}}, {{date_1}})
6. Set Result to Field: Number of Days.
Your Rule should looks like this screenshot:
Note: To calculate the difference we set the Check Out field before the Check In field.
That’s all!
Now your form should look like this: