[Solved] Calculate number of days between two dates

0

Hi – I have been trying with little success to add some javascript to my survey to calculate the number of days between two dates (the dates are answers to two survey questions) – can anyone help me out with this? 

My coding knowledge is limited so any help appreciated!

Thanks

Katie asked

    Best answer

    0

    I’ve used this in the past to make those kinds of calculations:

    http://stackoverflow.com/questions/2627473/how-to-calculate-the-number-of-days-between-two-dates-using-javascript

    I needed some help from a programmer I hired on upwork.com to get it all added though.  I recommend them.

    Matthew Albie answered
      • Thanks – I’d also seen this, and tried variations on it without much success – I may have another go, but I think I may need to concede defeat and draft in some help from someone who knows what they are doing!

      1

      There is an example of a custom script for comparing two dates in the SurveyGizmo documentation.

      The code is relatively simple so with a little work you might be able to modify it to suit your needs.

      Good luck.

      https://script.surveygizmo.com/help/article/link/calculate-age

      Jim Wetherill answered
        • I did previously comment on this but it seems to have vanished! Anyway – thanks for the suggestion – I had previously attempted to use this example as a basis but failed to get it to work… so back to the drawing board :(

        ×

        Login

        Question stats

        • Active
        • Views2102 times
        • Answers2 answers
        • Followers0 followers