I can't set the date format to dd/mm/yy with a jQuery Datepicker, when the language locale of the browser is English, it takes always this other format: mm/dd/yy.
This is the code:
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/i18n/jquery-ui-i18n.min.js"></script>
var from = $("#from");
var to = $("#to");
var dateFormat = "dd/mm/yy";
var lang = document.getElementById("language").innerHTML;
$(function(){
from.datepicker($.extend({
dateFormat: dateFormat
},
$.datepicker.regional[lang]
));
to.datepicker($.extend({
dateFormat: dateFormat
},
$.datepicker.regional[lang]
));
With other languages it works. How could I set the European (dd/mm/yy) date format in English? Thanks in advance for your help.