我一定是个白痴。我一直试图让bootstrap datepicker工作数小时失败。我需要在index.html中编写一个简单的日期选择器吗?
<html>
<head><title>A concrete example I will upload to github for future people</title>
<!-- What exactly do I need to include here? There's /js/bootstrap-datepicker.js -->
</head>
<body>
Datepicker:
<!-- The documentation says <input type="text" type="text" class="form-control"> -->
</body></html>
步骤
答案 0 :(得分:6)
或者,您可以:
<input data-provide="datepicker">
或js方法调用datepicker $('.datepicker').datepicker()
文档中有很多关于设置日期范围等内容的其他详细信息。http://bootstrap-datepicker.readthedocs.org/en/release/
你哪里被特意卡住了?
编辑:它可以像这样基本:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="plugins/bootstrap-datepicker-master/css/datepicker3.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<input data-provide="datepicker">
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="plugins/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
<script src="plugins/bootstrap-datepicker-master/js/bootstrap-datepicker.js"></script>
</body>
</html>