What's the goal ?
It is useful to do calculations on dates if you want to automatically calculate the date of a future intervention from the data filled in by your operator. You will be able to create a formula in a Date widget.
So what is this functionality ?
You can add and / or subtract days, months or years to a date.
You can then take the value of a first date, then add days, months or years.
The formulas to insert in your date widget will be:
- Days: ## tag_date ## + days (Number of days desired)
- Month: ## tag_date ## + months (Number of months desired)
- Years: ## tag_date ## + years (Number of years desired)
In practice, how to make calculations on dates ?
Context: Imagine a company that performs interventions on escalators. After a first intervention, a second checking intervention is systematically planned. This second intervention will always take place 11 days after the first.
1. Drag and drop a first Date widget into your form.
2. Name this widget date of intervention. Tick the current date option.
3. Drag and drop a second Date widget. Name the "Verification maintenance".
4. In the options, click on "formula".
5. Copy and paste the tag of the first date widget
6. Add a "+", then the word "days" and finally "(11)". We therefore ask to add 11 days.
7. Publish your form and take the test on the mobile application.