In this example, the Moment.js library is also required. Add two date inputs and a value output in the IO tab.

With the Script Helper, select the output button and click on the dateDifference button.

Replace date1 and date2 with the date input buttons respectively.

Replace counter with "'day'".

Your Script Helper should look like this:

Once you click Done, your codes should look like this:

'use strict'; return { a: moment(inputs.a).diff(inputs.b, 'day'), };

Your output should display this:

Did this answer your question?