Datepicker
Ver 1.7.3 more
Common settings
1 // disable the time before today $2 (". datePicker "). datepicker ('option', {minDate:-0, maxDate: "+ 10Y "}); 3 4 // display format of the selected date 5 var dateFormat = 'yy-mm-dd'; 6 $ ('. datePicker '). datepicker ({firstDay: 1, dateFormat: dateFormat });
Add tags in js and bind Datepicker events
For example, js dynamically adds the following html to the page,
<Input type = "text" class = "datePicker" readonly = "readonly">
The implementation method is simple. Just use the extended jQuery method provided by Datepicker. One article also introduces this issue. For more information, see.
1 $ ('input '). addClass ("datapicker"); 2 $ ('input '). datepicker ({3 dateFormat: "yy-mm-dd", 4 changeMonth: true, 5 changeYear: true, 6 showOn: 'both', 7 buttonImageOnly: true, 8 buttonImage: '/public/images/calendar.gif' 9 });