<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.22.0/moment-with-locales.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
js:
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
format: 'YYYY-MM-DD',
locale: moment.locale('zh-cn')
});
$('#datetimepicker2').datetimepicker({
format: 'YYYY-MM-DD ',
locale: moment.locale('zh-cn')
});
$('#datetimepicker3').datetimepicker({
format: 'YYYY-MM-DD ',
locale: moment.locale('zh-cn')
});
});
</script>
html:
<label class="col-sm-2 control-label">出生日期</label>
<div class="col-sm-3">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" >
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div><!--用时间组件补全-->
</div>