Search code examples
javascriptjquerytwitter-bootstraptwitter-bootstrap-3datetimepicker

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>

Solution

  • 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"         
        });