Reputation: 55
I'm having a problem with the Eonasdan Bootstrap datetimepicker. I copied and pasted the code from his website (minus the row and container because it made the layout of my panel messy). I suspect that the calendar is buried and not visible for some reason. I was hoping you guys could give me a hand!
<div class="col-sm-6">
<div class="form-group">
<div class="input-group date" id="datetimepicker1">
<input type="text" class="form-control active" />
<span class="input-group-addon btn">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$('#datepicker').off('focus').datepicker().click(
function () {
$(this).datepicker('show');
}
);
</script>
and here are my reference files so that you can see that I'm loading them properly.
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="js/bootstrap.min.js">
<link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="js/bootstrap-datetimepicker.min.js">
<link href="js/moment.min.js">
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
I hope you can give me a hand! Thanks.
Upvotes: 3
Views: 1420
Reputation: 71
Firstly, you need to call jquery before all js files.
Second, the click function is working and you can see some part os calendar or you can't view nothing?
Upvotes: 1
Reputation: 1210
i don't know why you are using
$('#datepicker').off('focus')
try this out.
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
locale: 'ru'
});
});
</script>
Upvotes: 0