bootstrap datepicker format
时间: 2023-10-06 22:07:06 浏览: 313
JS控件bootstrap datepicker使用方法详解
Bootstrap Datepicker is a popular datepicker plugin for Bootstrap framework. To set the format of date displayed in the Datepicker, you can use the `format` option.
Here's an example:
```
<input type="text" class="form-control" id="datepicker">
<script>
$(document).ready(function(){
$('#datepicker').datepicker({
format: 'yyyy-mm-dd'
});
});
</script>
```
In this example, the `datepicker` input field will display the selected date in the format of `yyyy-mm-dd`. You can change the format to your desired format.
Some common format options are:
- dd/mm/yyyy
- mm/dd/yyyy
- yyyy-mm-dd
- dd-mm-yyyy
- yyyy/mm/dd
You can find more information about formatting options in the official documentation of Bootstrap Datepicker.
阅读全文