[英]How to disable time in Bootstrap DateTimePicker?
I wanna use bootstrap datetimepicker without select time but it is not working. 我想在没有选择时间的情况下使用bootstrap datetimepicker,但它不起作用。 I gave false value to the pickTime parameter but it is still not working.
我给pickTime参数赋予了false值,但它仍然无效。 But Format and language parameters is working.
但格式和语言参数正常。
Here is the code! 这是代码! How can i fix this?
我怎样才能解决这个问题?
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
format: "dd MM yyyy",
pickTime: false,
autoclose: true,
todayBtn: true,
language: 'tr',
pickerPosition: "bottom-right"
});
});
</script>
<div class='input-group date' id='datetimepicker1'>
<span class="input-group-addon">Birtdate</span>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"> </span>
</span>
</div>
There are many datetimepicker plugin, so you need to details what plugin you used. 有许多datetimepicker插件,因此您需要详细说明您使用的插件。 If you use the plugin from http://eonasdan.github.io/bootstrap-datetimepicker/ .
如果您使用http://eonasdan.github.io/bootstrap-datetimepicker/中的插件。 I think, you may use wrong its option : read more at http://eonasdan.github.io/bootstrap-datetimepicker/Options/ .
我想,您可能会错误地选择它:在http://eonasdan.github.io/bootstrap-datetimepicker/Options/上阅读更多内容。 Here I removed almost, and just keep one:
在这里我几乎删除了,只保留一个:
$('#datetimepicker1').datetimepicker({
format: "dd MM yyyy"
});
try this remove pickTime Option and use minview : 2 试试这个删除pickTime选项并使用minview:2
$(function() {
$('#datetimepicker4').datetimepicker({
minView : 2
});
});
Try the below code, which will show only the date view, when the calendar is pulled down. 下拉日历时,请尝试以下代码,该代码仅显示日期视图。
$(function () {
$('#datetimepicker1').datetimepicker({
format: 'yyyy-mm-dd',
startView: 'month',
minView: 'month',
autoclose: true
});
});
I found this website online it disables the time picker 我在网上发现这个网站禁用了时间选择器
http://tarruda.github.io/bootstrap-datetimepicker/
<div class="well">
<div id="datetimepicker4" class="input-append">
<input data-format="yyyy-MM-dd" type="text"></input>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar">
</i>
</span>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#datetimepicker4').datetimepicker({
pickTime: false
});
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.