| 1 |
<!doctype html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 |
<title>jQuery UI Datepicker - Format date</title> |
| 7 |
<link rel="stylesheet" href="../../themes/base/all.css"> |
| 8 |
<link rel="stylesheet" href="../demos.css"> |
| 9 |
<script src="../../external/requirejs/require.js"></script> |
| 10 |
<script src="../bootstrap.js"> |
| 11 |
$( "#datepicker" ).datepicker(); |
| 12 |
$( "#format" ).on( "change", function() { |
| 13 |
$( "#datepicker" ).datepicker( "option", "dateFormat", $( this ).val() ); |
| 14 |
}); |
| 15 |
</script> |
| 16 |
</head> |
| 17 |
<body> |
| 18 |
|
| 19 |
<p>Date: <input type="text" id="datepicker" size="30"/></p> |
| 20 |
|
| 21 |
<p>Format options:<br /> |
| 22 |
<select id="format"> |
| 23 |
<option value="mm/dd/yy">Default - mm/dd/yy</option> |
| 24 |
<option value="yy-mm-dd">ISO 8601 - yy-mm-dd</option> |
| 25 |
<option value="d M, y">Short - d M, y</option> |
| 26 |
<option value="d MM, y">Medium - d MM, y</option> |
| 27 |
<option value="DD, d MM, yy">Full - DD, d MM, yy</option> |
| 28 |
<option value="'day' d 'of' MM 'in the year' yy">With text - 'day' d 'of' MM 'in the year' yy</option> |
| 29 |
</select> |
| 30 |
</p> |
| 31 |
|
| 32 |
<div class="demo-description"> |
| 33 |
<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> |
| 34 |
</div> |
| 35 |
</body> |
| 36 |
</html> |