bootstrap datetimepicker 添加日历功能
在对应html文件中的引入:
<link href="bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.min.js"></script>
<script src="bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.fr.js"></script>
html:
<input size="16" type="text" value="" id="starttime" name="starttime"
class="form_datetime form-control glyphicon ">
js:
$(".form_datetime").datetimepicker({
language: "zh-CN",//显示中文
format: 'yyyy-mm-dd',//显示格式
todayHighlight: 1,//今天高亮
minView: "month",//设置只显示到月份
startView:2,
forceParse: 0,
showMeridian: 1,
autoclose: 1//选择后自动关闭
});
结果为: