How do I add a time picker in a 12hr format with the ability to select AM/PM? | XM Community
Skip to main content
Solved

How do I add a time picker in a 12hr format with the ability to select AM/PM?


Hi Qualtrics Community,
I was wondering if anyone knows how to add a time picker in the format of a 12hr clock with the ability for the participant to select either AM/PM. I currently have a time picker however, it is in the 24hr clock format. Below are the codes I have used so far and a screenshot of the preview which work but again, I would like it to be in the 12hr clock format with the ability to select either AM/PM.
Header:
https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css"> src="">https://cdn.jsdelivr.net/npm/flatpickr">
JavaScript:
Qualtrics.SurveyEngine.addOnload(function()
{
  jQuery("#"+this.questionId+" .InputText").flatpickr({enableTime: true, noCalendar: true, dateFormat: "H:i"});
});
Screen Shot 2020-07-16 at 4.38.45 PM.pngThanks in advance for the help!

Best answer by rondev

Change capital H to small 'h', so the code is:

jQuery("#"+this.questionId+" .InputText").flatpickr({enableTime: true, noCalendar: true, dateFormat: "h:i K"});


View original

3 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • 1449 replies
  • Answer
  • July 16, 2020

Change capital H to small 'h', so the code is:

jQuery("#"+this.questionId+" .InputText").flatpickr({enableTime: true, noCalendar: true, dateFormat: "h:i K"});



  • Author
  • 2 replies
  • August 20, 2020

Forum|alt.badge.img

I don't understand why adding a time picker is not in the library. I am non-technical, can someone please provide step-by-step guidance on how I can enter this into my survey to allow me to capture a time. I'm struggling with this. Thanks in advance.


Leave a Reply