I’ve got a form where I’ve implemented Flatpickr, but need it to only display the current year through the end of the year. I know I could do minDate and maxDate: “12/31/24” but I want it to be dynamic so I don’t have to remember to go in and change the year manually.
I tried to just enable a date range, but that didn’t work as expected. It only displayed the calendar through the end of the year, but none of the dates were actually enabled.
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#question-"+this.questionId+" .text-input").flatpickr({
dateFormat: "m/d/y",
altInput: true,
altFormat: "F j, Y",
defaultDate:"today",
maxDate: "12/31/24",
/*enable: >
{
from: "today",
to: "12/31/24"
}
],*/
onChange: function(selectedDates, dateStr, instance) {
Qualtrics.SurveyEngine.setJSEmbeddedData("date1",dateStr);
}
});
});
Thoughts? Anyone else have a similar need and run into issues?