I want to disable past dates from the datepicker using bootstrab 2.3.2. I have tried the following code taken from documents, but now i am still battling with this concept. Can anyone give me some ideas? What is wrong with my code?
<div class="input-append date" data-date-format="dd-mm-yyyy" > <input name="date_pick" id="dpd1" type="text" required style="padding:8px 0 !important"> <span class="add-on"><i class="icon-calendar sh_black_text"></i></span> </div> My Script
$(function(){ $('.date').datepicker({}); var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); var checkin = $('#dpd1').datepicker({ onRender: function(date) { return date.valueOf() < now.valueOf() ? 'disabled' : ''; } }) });