My code is like this :
HTML :
<div class="input-append date datepicker no-padding" data-date-format="dd-mm-yyyy">
<input class="input-medium" size="16" type="text"><span class="add-on"><i class="icon-th"></i></span>
</div>
Javascript :
$(document).ready(function() {
$('.datepicker').datepicker({
autoclose: true,
startDate: new Date()
});
});
Demo : jsfiddle
I want to change the size of the bootstrap datepicker
Any suggestion to solve my problem
Thank you
You can control the width using .datepicker
and .table-condensed
selectors:
$(document).ready(function() {
$('.datepicker').datepicker({
autoclose: true,
startDate: new Date()
});
});
.datepicker,
.table-condensed {
width: 500px;
height:500px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/css/datepicker.css" rel="stylesheet" />
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script>
<script src="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<div class="input-append date datepicker no-padding" data-date-format="dd-mm-yyyy">
<input class="input-medium" size="16" type="text"><span class="add-on"><i class="icon-th"></i></span>
</div>
You need to apply both because .table-condensed
has max-width:100%
. if you get rid of this you can control the size using .datepicker
Here is the magic spell that worked well for me. And it does well in most browsers.
.datepicker,
.table-condensed {
width: 220px;
height: 220px;
font-size: x-small;
}
Basically, it displays a scaled down size of the bootstrap datepicker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With