-3

https://i.stack.imgur.com/vK4OB.png

目前我的显示是这样的。

我有一个母版页,用于导入我的 css 和 js。

<link href="assets/css/datepicker.css" rel=Stylesheet />
<link href="assets/css/bootstrap-responsive.css" rel=Stylesheet />
<link href="assets/css/bootstrap.css" rel=Stylesheet />
<link href="assets/css/docs.css" rel=Stylesheet />
<link href="assets/less/bootstrap.less" type="text/css" rel="Stylesheet/less" />

在头部和 javascript 中:

<script src="assets/js/less-1.3.0.min.js" type="text/jscript"></script>
<script src="assets/js/jquery.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-transition.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-alert.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-modal.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-dropdown.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-scrollspy.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-tab.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-tooltip.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-popover.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-button.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-collapse.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-carousel.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-datepicker.js" type="text/jscript"></script>
<script src="assets/js/bootstrap-typeahead.js" type="text/jscript"></script>
<script>
  $('#datepicker').datepicker();
</script>

控制:

<div class="input-append date" id="datepicker" data-date="12-02-2012"
data-date-format="dd-mm-yyyy">
<input size="16" type="text" value="12-02-2012" readonly>
<span class="add-on"><i class="icon-th"></i></span> </div>

想让日子像他们应该的那样水平,不知道我错过了什么?

4

1 回答 1

2

我认为这就是你需要的DEMO

HTML:

<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
  <input class="span2" size="16" type="text" value="12-02-2012">
  <span class="add-on"><i class="icon-th"></i></span>
</div>​

脚本:

$('#dp3').datepicker();
var startDate = new Date(2012,1,20);
var endDate = new Date(2012,1,25);​
于 2012-05-14T16:27:16.387 回答