Calculate between two dates having two datepicker questions | XM Community
Question

Calculate between two dates having two datepicker questions

  • 5 July 2019
  • 1 reply
  • 22 views

Userlevel 3
Badge +5
Hello,

In a survey I want to calculate the number of day's between two dates. For our students who do an internship I want to know how many day's they go for the internship.

So I have two questions: Q1 is the starting date of the internship and Q2 is the ending date of the internship.

When possible I want to display the number of days when both questions are filled or amended.

How can I setup such a block?

Kind regards,
Nico Leussink

1 reply

Userlevel 7
Badge +27
Nico,

Use momentjs to calculate the difference in number of days. If both questions are on the same page, you can calculate, save and display the days on the same page using event handlers.

Leave a Reply