<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="bscripts/bootstrap.js" type="text/javascript"></script>
<link href="Styles/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="Styles/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
<script src="Js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<script src="bscripts/jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="container" style="margin-top:100px;">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<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>
</div>
</div>
</div>
</form>
</body>
</html>
这个日期时间选择器不起作用我已经包含了javascript和插件的CSS? http://eonasdan.github.io/bootstrap-datetimepicker/#example1根据此链接,这必须解决此代码中的错误。
答案 0 :(得分:0)
在包含bootstrap-datetimepicker.js文件之前,还需要添加moment.js。
<script src="bscripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="bscripts/bootstrap.js" type="text/javascript"></script>
<link href="Styles/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="bscripts/moment.js" type="text/javascript"></script>
<link href="Styles/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
<script src="Js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
请参阅fiddle here。