根据
documentation
:
var date = $(this).datepicker('getDate', true);
jQuery('[data-toggle="datepicker"]').datepicker({
format: 'yyyy-mm-dd',
pick: function(e) {
var date = $(this).datepicker('getDate', true);
jQuery(this).attr('value', date)
}
});
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link href="https://fengyuanchen.github.io/datepicker/css/datepicker.css" rel="stylesheet" />
<script src="https://fengyuanchen.github.io/datepicker/js/datepicker.js"></script>
<input id="leftBound" data-date-format="yyyy.mm.dd" data-toggle="datepicker" class="leftBound form-control" type="input" name="left_bound" value="" />