0

I am using bootstrap date picker (http://www.eyecon.ro/bootstrap-datepicker). I would like to set start limit of datepicker (I want to restrict going back date from today.). I have read documentation and related answers on stackoverflow (Bootstrap DatePicker, how to set the start date for tomorrow?) but could not set start date.

My codes:

Html:

<input name="endDate" class="datepicker form-control pull-right" data-date-format="dd.mm.yyyy" value="19.05.2016">

Javascript:

$('.datepicker').datepicker({
    language: 'tr',
    autoclose: true,
    startDate: '+1d' //for just test
});
Community
  • 1
  • 1
Dreamcatcher
  • 798
  • 13
  • 31

1 Answers1

0

It is working correctly, but you just don't see it because you are on next month. Check this fiddle

By setting value="19.05.2016"you set the default selected day to 19.05.2016, thus you are on May motnh tab. The option startDate: '+1d' set the default selectable period to start from +1d from today. That's pretty clear in the Fiddle, if you look at what date is set as value and how many days are added in startDate option.

Yuri
  • 3,082
  • 3
  • 28
  • 47