@{ Layout = null; } <div> <input type="text" id="fromdatepicker" value="" style="width:75px" /> 到 <input type="text" id="todatepicker" style="width:75px" /> </div> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script type="text/javascript"> var grid = null; var d = new Date(); var day = "" + d.getDate(); var month = "" + (d.getMonth() + 1); day = day.length < 2 ? "0" + day : day; month = month.length < 2 ? "0" + month : month; var today = d.getFullYear() + "-" + month + "-" + day; $(function () { $("#fromdatepicker").datepicker(); $("#todatepicker").datepicker(); $("#fromdatepicker").val(today); $("#todatepicker").val(today); }); </script>
转载于:https://www.cnblogs.com/a159189/p/4174090.html