-
Cristallina83Asked on February 23, 2018 at 5:01 PM
Hi again Richie,
is there a way I can have a sort of add-on to help me calculating how many nights are selected?
Example:
I have check-in date: 04.06.2018 and check-out date at 08.06.2018. It is 4 nights stay.
Is there a widget that inserting a date for check-in and check-out automatically calculates me the nights?
Thanks in advance.
-
Elton Support Team LeadReplied on February 23, 2018 at 5:21 PM
If you are using the date picker fields, that is possible using the update/calculation condition. Guide: https://www.jotform.com/help/268-How-to-Insert-Text-or-Calculation-into-a-Field-Using-Conditional-Logic
Example:
There's also a widget that is designed for this purpose https://widgets.jotform.com/widget/dates_difference
To get the date difference value, just use form calculation widget and add the date difference widget in the calculation wizard.
-
Cristallina83Replied on February 23, 2018 at 5:49 PM
Thank you so much Elton.
Is it possible to see just the number without any other character?
I show you how it shows.
It says: difference: 2 days.
I would like to see only the number 2 if possible.
Thanks for your support!
-
Kevin Support Team LeadReplied on February 23, 2018 at 8:52 PM
You should make sure that the date differences widget returns the difference only:
Once you have done this, you need to change the field included on the form calculation widget, click on it to include it as numeric value instead of text:
Result: https://form.jotform.com/80537507230956
I hope this helps.
-
Cristallina83Replied on February 24, 2018 at 7:35 AM
Thank you Kevin!
I did it and it works perfectly!