Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flatpickr mobile format

i am using ember-flatpickr version 2.12.0 and I am facing a formatting issue on mobile devices. I set the property dateFormat to "d.m.Y" which works fine on desktop browsers, but on mobiles formates to "mm/dd/yyyy". Can somebody help me with this? check out the screenshot

  • flatpickr version used: 4.5.4

Here is repro link, just switch your browser to responsive mode or check it on mobile. Thank you for advices

const fp = flatpickr(".date", {
	dateFormat: 'd.m.Y'
});
article {
  padding: 16px;
  width: 50%
}
<link href="https://npmcdn.com/[email protected]/dist/flatpickr.css" rel="stylesheet"/>
<script src="https://npmcdn.com/[email protected]/dist/flatpickr.js"></script>
<article>
  <input type="text" placeholder="Select Date.." class=date>
</article>
like image 736
coldfusion Avatar asked Sep 01 '25 16:09

coldfusion


1 Answers

For anyone who are facing the same problem, you can disable the mobile view option.

Add the following option in flatpickr:

{
    disableMobile: "true"
}

For more information, Mobile Support - FlatPickr Documentation

like image 98
Lizesh Shakya Avatar answered Sep 04 '25 16:09

Lizesh Shakya