1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
---|
5 | <title>Datepicker default date bug</title> |
---|
6 | <link type="text/css" href="css/smoothness/jquery-ui-1.8.5.custom.css" rel="stylesheet" /> |
---|
7 | <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> |
---|
8 | <script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"></script> |
---|
9 | <script type="text/javascript"> |
---|
10 | // Datepicker |
---|
11 | $(document).ready(function() { |
---|
12 | $('.pre').datepicker({defaultDate: new Date(2009, 0, 1)}); |
---|
13 | $(".post").datepicker({}); |
---|
14 | $(".post").datepicker('option', 'defaultDate', new Date(2009, 0, 1)); |
---|
15 | }); |
---|
16 | </script> |
---|
17 | </head> |
---|
18 | <body> |
---|
19 | <!-- Datepicker --> |
---|
20 | <h2>Datepicker as input, default in constructor</h2> |
---|
21 | <input class="pre"> |
---|
22 | <h2>Datepicker as div, default in constructor</h2> |
---|
23 | <div class="pre"></div> |
---|
24 | <h2>Datepicker as div, set default after the fact</h2> |
---|
25 | <input class="post"> |
---|
26 | <h2>Datepicker as div, set default after the fact</h2> |
---|
27 | <div class="post"></div> |
---|
28 | </body> |
---|
29 | </html> |
---|
30 | |
---|
31 | |
---|