Search code examples
bootstrap-datetimepicker

bootstrap datepicker how to disable the current date by default


i am using bootstrap datetime picker, when we click on calendar icon, the current dete is fetching on my relevant input.

Is that any way to avoid that? because i don't want to current date by default fetching on input, it should be user selected value only.

Basically the calendar should open, but i don't need any default values on my input.

Rfer: http://jsfiddle.net/m2fjw57b/45/

HTML:
<div class="input-group date" id='date'>
   <input type='text' class="form-control" />
      <span class="input-group-addon">
      <span class="fa fa-calendar"></span>
   </span>
</div>

JS:
 $(document).ready(function () {
     $('#date').datetimepicker({
         //defaultDate: new Date()
         //date-disabled="now"
         //default: false
     });
 });

Solution

  • There is a solution provided, ideally you just need to disable current selection.

    $(document).ready(function () {$('#date').datetimepicker({useCurrent: false});});
    

    Demo

    Cheers,

    Ashok