Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
     });
 });
like image 320
Krish Avatar asked Dec 28 '15 05:12

Krish


People also ask

How do I change the default date in datepicker?

Syntax: $(". selector"). datepicker( {defaultDate:"+6"} );

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

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


1 Answers

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

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

Demo

Cheers,

Ashok

like image 189
Ashok Kumar Gupta Avatar answered Sep 21 '22 23:09

Ashok Kumar Gupta