jQuery Mobile UI DatePicker更改日期格式

| 我正在尝试在JQM UI Datepicker中更改日期格式。 它有一个输入,显示更改日期时的日期。 我需要它以dd / mm / yyyy格式显示。 有人可以帮忙吗? 更新: 我正在尝试,但是没有任何变化:
<script>
  //reset type=date inputs to text
  $( document ).bind( \"mobileinit\", function(){
    $.mobile.page.prototype.options.degradeInputs.date = true;

  });   
</script>

<script language=\"javascript\">
    $(document).ready(function() {
        $.datepicker.formatDate(\'dd/mm/yyyy\'); //ADDED HERE
        $(\"input[type=\'submit\']\").click(function(e) {
            e.preventDefault();
        });
    });

</script>
    
已邀请:
试试这个
$.datepicker.formatDate(\'dd/mm/yyyy\');
在这里更多参考     
更改\“ jquery.ui.datepicker.mobile.js \”文件 添加日期格式:dateFormat:\“ dd / mm / yy \”代码如下所示
//bind to pagecreate to automatically enhance date inputs   
    $( \".ui-page\" ).live( \"pagecreate\", function(){     
        $( \"input[type=\'date\'], input[data-type=\'date\']\" ).each(function(){
            $(this).after($(\"<div />\").datepicker({ altField: \"#\" + $(this).attr(\"id\"), showOtherMonths: true, dateFormat: \"dd/mm/yy\" }));
        }); 
    });
    

要回复问题请先登录注册