Need help applying date format to Flatpickr | XM Community
Solved

Need help applying date format to Flatpickr

  • 15 March 2019
  • 1 reply
  • 39 views

Userlevel 6
Badge +5
Can anyone assist me with this.

Here is my current code: ``{
/*Place your JavaScript here to run when the page loads*/jQuery("#"+this.questionId+" .InputText").flatpickr();
jQuery("#"+this.questionId+" .InputText").attr("placeholder", "Click Here to Select a Date");
});``

I want the format of the date to be mm/dd/yyyy. I believe I just have to add this string in somewhere but I am not sure where: dateFormat: "M-D-Y"

Thanks in advance!
icon

Best answer by dobra021 15 March 2019, 17:14

View original

1 reply

Userlevel 5
Badge +36
Try this
``
.flatpickr({dateFormat: "m-d-Y"})
``

Leave a Reply