Display logic based on date using javascript | XM Community
Skip to main content
From what I've read it seems Qualtrics does not provide display logic options for dates. Can anyone advise re: javascript code that would check the date a survey was being taken against a user-provided date(s). I want to allow survey completion if the date on which the survey is being taken corresponds to +/-7 days of a user-provided date.
If it were me, I would probably use a web service script instead of JavaScript for this.



Anyway, in JavaScript use Date.parse to convert the date strings to dates, then compare. Set an embedded data field based on the comparison that you can then use in the survey flow or display logic.

Leave a Reply