<!DOCTYPE HTML>
<html>
<head>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen"
href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css">
</head>
<body>
<div id="datetimepicker" class="input-append date">
<input type="text"></input>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-datetimepicker.min.js"></script>
<script src="js/bootstrap-datepicker.zh-CN.js"></script>
<script type="text/javascript">
$('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
language: 'zh-CN',
pickTime: false
}).on('changeDate',function(){
$(this).datetimepicker('hide');
});
</script>
</body>
1.1. 准备工作
1.1.1. Jquery的下载
下载地址: http://jquery.com/download/
1.1.2. Bootstrap的下载
下载地址: http://v3.bootcss.com/getting-started/#download
1.1.3. 日期插件下载
http://tarruda.github.io/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js
1.2. 日期插件的使用
datetimepicker.html |
1.3. 效果