// Add configuration during initialization $('#time').datepicker({ // Set language language: 'zh-CN', // Close automatically after selecting a date autoclose: true, // Show clear button clearBtn: true, // Specify date format format: "yyyy-mm-dd", // Specify the earliest selectable time startDate: "", // Specify the latest selectable time endDate: "" // Specify the latest selectable time as the current time //endDate: new Date() });
Built-in functions
Destroy date picker
1 2 3
$('#time').datepicker('destroy');
$('#time').datepicker('remove');
Show date picker
1
$('#time').datepicker('show');
Hide date picker
1
$('#time').datepicker('hide');
Update date picker
Update the date in the text box to the date picker