Examples of Using Datepickers
This section includes some practical examples of using datepickers.
Displaying a Calendar in Another Language
<script src = jquery.js></script> <script src = jqueryui/js/jquery-ui-1.8.16.custom.min.js></script> <script src=jqueryui/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js></script> <link rel=stylesheet type=text/css href=jqueryui/css/smoothness/jquery-ui-1.8.16.custom.css /> <h3>Click to select a date :</h3> <input id=date /> <script> $("input#date").datepicker (); </script>
Figure 8-4. Calendar in French
Displaying Multiple Months in the Calendar
Several months can be displayed in the calendar (Figure 8-5). For this, we use
options.numberOfMonths, which indicates the
desired number of months or an array [x,
y] that contains the number of rows (x) and columns (y) that
represent these months.
Use the following (in bold) to display a calendar of four months (two rows of two, shown in Figure 8-5):
<script src=jquery.js></script> <script src=jqueryui/development-bundle/ui/jquery-ui-1.8.4.custom.js></script> <script src=jqueryui/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js> ...