Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要在下面的Jquery代码中更改日期格式_Jquery - Fatal编程技术网

需要在下面的Jquery代码中更改日期格式

需要在下面的Jquery代码中更改日期格式,jquery,Jquery,我在程序中使用以下代码创建一个我要更改我的日期的“到”和“从”日期 显示的日期格式当前格式:mm/dd/yyyy到我的要求:dd/mm/yyyy <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <scri

我在程序中使用以下代码创建一个我要更改我的日期的“到”和“从”日期 显示的日期格式当前格式:mm/dd/yyyy到我的要求:dd/mm/yyyy

<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>

<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>


jQuery(function(){
    jQuery('#startDate').datepicker({
        beforeShow : function(){
            jQuery( this ).datepicker('option','maxDate', jQuery('#endDate').val() );
        }
    });
    jQuery('#endDate').datepicker({
        beforeShow : function(){
            jQuery( this ).datepicker('option','minDate', jQuery('#startDate').val() );
        }
    });
})
  </script>
  </head>
  <body>

  <p>From Date: <input type="text" id="startDate"> To Date: <input type="text" id="endDate" onchange=""></p>


 </body>
 </html>
谢谢你

您可以在.datepicker中使用dateFormat:dd/mm/yy

大概是

.datepicker({
    dateFormat: "dd/mm/yy"
})

@Richard Dalton我想知道如何在我的代码中添加scriplet,因为我尝试了所有可能的方法,但它不起作用,要么它显示默认日期格式,要么我无法选择日期本身。因此,请删除标记为重复的