Time field | XM Community
Skip to main content
Solved

Time field

  • June 10, 2020
  • 1 reply
  • 123 views

JR33
QPN Level 2 ●●
Forum|alt.badge.img+10
  • QPN Level 2 ●●

Hi everyone,
I'm looking to create a question with a preformatted time field (ex: what time do you arrive at work in the morning?).
What is the simplest method? I found some answers with Flatpickr, or using a field like but I can't really get them to work into the Qualtrics environment despite long searches on this forum.
Thanks for your help

Best answer by TomG

input type=time doesn't work with Safari, so you should probably avoid it.
Flatpickr should work. Add the flatpickr stylesheet and script to your survey header. Then to your time question:
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .InputText").flatpickr({
enableTime: true,
noCalendar: true,
dateFormat: "H:i"
});
});

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • June 11, 2020

input type=time doesn't work with Safari, so you should probably avoid it.
Flatpickr should work. Add the flatpickr stylesheet and script to your survey header. Then to your time question:
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .InputText").flatpickr({
enableTime: true,
noCalendar: true,
dateFormat: "H:i"
});
});