[Solved] Calculate a date based on a date field and a # of days field

0

I am looking to gather input on hunting seasons.  I currently ask the respondent “What date would you like the first season split to begin on?” and then “how many days do you want the 1st split to be?”

 

Based on these 2 inputs I would like a summary field to tell them the end date.

 

EX:

 

I select a start date of October 10th 2016 and a 9 day season.  I’d like an output to show them an end date of October 18th.

 

Is there an easy way to do that?  I am trying to avoid giving them two date boxes because they are restricted to total season length of 60 days.  If they just pick dates on both ends, it is difficult for them to calculate the total number of days. 

DFWMR asked

    Best answer

    0

    Hey DFWMR! Thanks for using Community :)

    I just wanted to chime in and give you the scoop on this as far as built-in features go. We sadly do not have any question types or features that will calculate a date for you in this way. The behavior you described would only be possible through the addition of some custom code in your survey. In this case, I believe Custom Scripting (PHP) specifically may be easiest, using the sgapiStrtotime() and sgapiDate() functions.

    Nathan - Survey Astronaut answered
      ×

      Login

      Question stats

      • Active
      • Views336 times
      • Answers1 answer
      • Followers0 followers