Clear the JS and paste it inside onReady function of text entry question JS
rondev Hi rondev, thanks for the help above regarding the flatpickr code. I came across flatpickr when trying to get a month only view as it had been announced that flatpickr now had that functionality through some sort of plugin attribute (https://flatpickr.js.org/plugins/) (see pic below for the result)I added in the altered code with the plugin part (see https://flatpickr.js.org/plugins/ )
uatrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
jQuery("#"+this.questionId+" .InputText").flatpickr({
//dateFormat: "Y-m-d H:i",
inline: true,
//minDate: new Date(),
static: true,
altInput: true,
plugins: [
new monthSelectPlugin({
shorthand: true, //defaults to false
dateFormat: "m.y", //defaults to "F Y"
altFormat: "F Y", //defaults to "F Y"
theme: "dark" // defaults to "light"
})
]
});
});
and then from a thread (https://github.com/flatpickr/flatpickr/issues/269) I found out that I needed to change the href and script in the look and feel section to include the additional lines:
I'm not sure if you need all 4 lines but it works as it is.I piped the previous question answer over and it gives (I changed the dateFormat to d/m/y to get this:
I guess there are many other alternatives for Month Views but due to my minimal knowledge of JS script, it's often difficult to work out how to map it and get it working. If you have any JS tips or guidance for the future or know of a really good JS script course (for Qualtrics) that would be great.
Thanks
Rod Pestell
I would like to enter a field to record the current date and time(arrival time) into a survey. Plus I would like a field to give the current date but to edit the time to later in the day (estimating departure time). I don't have any idea about coding, but am excellent at cutting and pasting. Can anyone help? Thanks
Kirrily_Rourke Although a little late replying (sorry!) I'd do two separate flatpickr fields and then combine the results together via an embedded field in the survey flow. If you want the system to understand it as a true timestamp, I presume you need to follow the proper UTC format which has a T in the middle and a Z at then end.
Hope that helps
Rod Pestell
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.