admin管理员组文章数量:1026114
I am trying to use BootStrap DateTimePicker and it is not displaying properly on the screen. My HTML looks like below.
<div class='input-group date' id='startDate'>
<input type='text' class="form-control" name="startDate" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</div>
And the Javascript is like below.
$(document).ready(function () {
// DateTime picker for Dates
$("#startDate").datetimepicker();
});
And the order in which I am loading my javascript and css files is as below.
<link href="/Content/css/datepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<script src="/Scripts/jquery-2.1.0.js"></script>
<script src="/Scripts/jquery-ui-1.10.0.custom.js"></script>
<script src="/Scripts/bootstrap-datepicker.js"></script>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/moment.js"></script>
<script src="/Scripts/bootstrap-datetimepicker.js"></script>
With the above set up, datetime picker is displaying as below without any proper css. The arrow buttons to change the month are not displayed correctly.
I tried changing the order, but still displaying the same. Can someone help me with what i am missing?
I am trying to use BootStrap DateTimePicker and it is not displaying properly on the screen. My HTML looks like below.
<div class='input-group date' id='startDate'>
<input type='text' class="form-control" name="startDate" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</div>
And the Javascript is like below.
$(document).ready(function () {
// DateTime picker for Dates
$("#startDate").datetimepicker();
});
And the order in which I am loading my javascript and css files is as below.
<link href="/Content/css/datepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<script src="/Scripts/jquery-2.1.0.js"></script>
<script src="/Scripts/jquery-ui-1.10.0.custom.js"></script>
<script src="/Scripts/bootstrap-datepicker.js"></script>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/moment.js"></script>
<script src="/Scripts/bootstrap-datetimepicker.js"></script>
With the above set up, datetime picker is displaying as below without any proper css. The arrow buttons to change the month are not displayed correctly.
I tried changing the order, but still displaying the same. Can someone help me with what i am missing?
Share Improve this question asked Nov 24, 2014 at 15:34 DevDev 1,5614 gold badges26 silver badges36 bronze badges 1- why to use both <script src="/Scripts/bootstrap-datepicker.js"></script> and <script src="/Scripts/bootstrap-datetimepicker.js"></script> ? can't you just use the datepicker script? – ymz Commented Nov 24, 2014 at 21:53
1 Answer
Reset to default 4Ok, check this fiddle:
http://jsfiddle/8hmcfmLh/1/
you don't need jquery-ui or bootstrap-datepicker, just bootstrap-datetimepicker and moment.js
<div class="input-group date" id="startDate">
<input type="text" class="form-control" name="startDate" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>
$(document).ready(function () {
// DateTime picker for Dates
$("#startDate").datetimepicker();
});
I am trying to use BootStrap DateTimePicker and it is not displaying properly on the screen. My HTML looks like below.
<div class='input-group date' id='startDate'>
<input type='text' class="form-control" name="startDate" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</div>
And the Javascript is like below.
$(document).ready(function () {
// DateTime picker for Dates
$("#startDate").datetimepicker();
});
And the order in which I am loading my javascript and css files is as below.
<link href="/Content/css/datepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<script src="/Scripts/jquery-2.1.0.js"></script>
<script src="/Scripts/jquery-ui-1.10.0.custom.js"></script>
<script src="/Scripts/bootstrap-datepicker.js"></script>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/moment.js"></script>
<script src="/Scripts/bootstrap-datetimepicker.js"></script>
With the above set up, datetime picker is displaying as below without any proper css. The arrow buttons to change the month are not displayed correctly.
I tried changing the order, but still displaying the same. Can someone help me with what i am missing?
I am trying to use BootStrap DateTimePicker and it is not displaying properly on the screen. My HTML looks like below.
<div class='input-group date' id='startDate'>
<input type='text' class="form-control" name="startDate" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</div>
And the Javascript is like below.
$(document).ready(function () {
// DateTime picker for Dates
$("#startDate").datetimepicker();
});
And the order in which I am loading my javascript and css files is as below.
<link href="/Content/css/datepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<script src="/Scripts/jquery-2.1.0.js"></script>
<script src="/Scripts/jquery-ui-1.10.0.custom.js"></script>
<script src="/Scripts/bootstrap-datepicker.js"></script>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/moment.js"></script>
<script src="/Scripts/bootstrap-datetimepicker.js"></script>
With the above set up, datetime picker is displaying as below without any proper css. The arrow buttons to change the month are not displayed correctly.
I tried changing the order, but still displaying the same. Can someone help me with what i am missing?
Share Improve this question asked Nov 24, 2014 at 15:34 DevDev 1,5614 gold badges26 silver badges36 bronze badges 1- why to use both <script src="/Scripts/bootstrap-datepicker.js"></script> and <script src="/Scripts/bootstrap-datetimepicker.js"></script> ? can't you just use the datepicker script? – ymz Commented Nov 24, 2014 at 21:53
1 Answer
Reset to default 4Ok, check this fiddle:
http://jsfiddle/8hmcfmLh/1/
you don't need jquery-ui or bootstrap-datepicker, just bootstrap-datetimepicker and moment.js
<div class="input-group date" id="startDate">
<input type="text" class="form-control" name="startDate" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>
$(document).ready(function () {
// DateTime picker for Dates
$("#startDate").datetimepicker();
});
本文标签: javascriptCan not get bootstrap datetime picker to display properlyStack Overflow
版权声明:本文标题:javascript - Can not get bootstrap datetime picker to display properly - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745623674a2159728.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论