|
1 <!DOCTYPE html> |
|
2 <html lang="en"> |
|
3 <head> |
|
4 <meta charset="UTF-8" /> |
|
5 <title>jQuery UI Datepicker - Format date</title> |
|
6 <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> |
|
7 <script type="text/javascript" src="../../jquery-1.4.2.js"></script> |
|
8 <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script> |
|
9 <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script> |
|
10 <script type="text/javascript" src="../../ui/jquery.ui.datepicker.js"></script> |
|
11 <link type="text/css" href="../demos.css" rel="stylesheet" /> |
|
12 <script type="text/javascript"> |
|
13 $(function() { |
|
14 $("#datepicker").datepicker(); |
|
15 $("#format").change(function() { $('#datepicker').datepicker('option', {dateFormat: $(this).val()}); }); |
|
16 }); |
|
17 </script> |
|
18 </head> |
|
19 <body> |
|
20 |
|
21 <div class="demo"> |
|
22 |
|
23 <p>Date: <input type="text" id="datepicker" size="30"/></p> |
|
24 |
|
25 <p>Format options:<br /> |
|
26 <select id="format"> |
|
27 <option value="mm/dd/yy">Default - mm/dd/yy</option> |
|
28 <option value="yy-mm-dd">ISO 8601 - yy-mm-dd</option> |
|
29 <option value="d M, y">Short - d M, y</option> |
|
30 <option value="d MM, y">Medium - d MM, y</option> |
|
31 <option value="DD, d MM, yy">Full - DD, d MM, yy</option> |
|
32 <option value="'day' d 'of' MM 'in the year' yy">With text - 'day' d 'of' MM 'in the year' yy</option> |
|
33 </select> |
|
34 </p> |
|
35 |
|
36 </div><!-- End demo --> |
|
37 |
|
38 <div class="demo-description"> |
|
39 |
|
40 <p>Display date feedback in a variety of ways. Choose a date format from the dropdown, then click on the input and select a date to see it in that format.</p> |
|
41 |
|
42 </div><!-- End demo-description --> |
|
43 |
|
44 </body> |
|
45 </html> |