菜鸟新手taob 2011-10-13
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="utf-8">
<title>jQueryUIDatepicker-Formatdate</title>
<linkrel="stylesheet"href="../../themes/base/jquery.ui.all.css">
<scriptsrc="../../jquery-1.6.2.js"></script>
<scriptsrc="../../ui/jquery.ui.core.js"></script>
<scriptsrc="../../ui/jquery.ui.widget.js"></script>
<scriptsrc="../../ui/jquery.ui.datepicker.js"></script>
<linkrel="stylesheet"href="../demos.css">
<script>
$(function(){
$("#datepicker").datepicker();
$("#format").change(function(){
$("#datepicker").datepicker("option","dateFormat",$(this).val());
});
});
</script>
</head>
<body><div class="demo">
<p>Date: <input type="text" id="datepicker" size="30"/></p>
<p>Format options:<br />
<selectid="format">
<optionvalue="mm/dd/yy">Default-mm/dd/yy</option>
<optionvalue="yy-mm-dd">ISO8601-yy-mm-dd</option>
<optionvalue="dM,y">Short-dM,y</option>
<optionvalue="dMM,y">Medium-dMM,y</option>
<optionvalue="DD,dMM,yy">Full-DD,dMM,yy</option>
<optionvalue="'day'd'of'MM'intheyear'yy">Withtext-'day'd'of'MM'intheyear'yy</option>
</select>
</p></div><!-- End demo -->
<div class="demo-description">
<p>Displaydatefeedbackinavarietyofways.Chooseadateformatfromthedropdown,thenclickontheinputandselectadatetoseeitinthatformat.</p>
</div><!-- End demo-description --></body>
</html>