Hello,
I have created a survey with two dates (start date and end date). I would like the maxDate for the end date to equal the selected start date plus 7 days. I am having a difficult time getting this to work. I don't know how to access the start and end date objects and set their min/max date values. Please see my code below.
Qualtrics.SurveyEngine.addOnReady(function()
{
//start date
jQuery("#"+this.questionId+" .InputText:first").flatpickr({
dateFormat: "m-d-Y",
minDate: "today",
defaultDate: "today"
});
//end date
jQuery("#"+this.questionId+" .InputText:last").flatpickr({
dateFormat: "m-d-Y",
minDate: "today",
maxDate: new Date().fp_incr(7) // 7 days from today
});
//set the maxDate for end date to the selected start date plus 7 days.
jQuery("#"+this.questionId+" .InputText:first").on('change', function(){
var startDate = this.value;
alert(startDate)
});
});
Setting the maxDate value for one flatpickr to the minDate of another flatpickr
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
