Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable time in Bootstrap DateTimePicker?

I wanna use bootstrap datetimepicker without select time but it is not working. I gave false value to the pickTime parameter but it is still not working. 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>
like image 635
Emre BEGEN Avatar asked Feb 11 '15 08:02

Emre BEGEN


People also ask

How do I turn off the time on my date picker?

To disable the DateTimePicker, use its enable property to false .


2 Answers

try this remove pickTime Option and use minview : 2

$(function() {
  $('#datetimepicker4').datetimepicker({
    minView : 2
  });
});
like image 188
pramod kadam Avatar answered Sep 28 '22 04:09

pramod kadam


There are many datetimepicker plugin, so you need to details what plugin you used. If you use the plugin from http://eonasdan.github.io/bootstrap-datetimepicker/. I think, you may use wrong its option : read more at http://eonasdan.github.io/bootstrap-datetimepicker/Options/. Here I removed almost, and just keep one:

    $('#datetimepicker1').datetimepicker({
        format: "dd MM yyyy"         
    });
like image 45
Nguyen Linh Avatar answered Sep 28 '22 06:09

Nguyen Linh