Bootstrap Datepicker Disable Previous Dates

Hello,

I want to disable previous dates,

i am Using Bootstrap datepicker.

<?php echo $form->datepickerRow($model,‘ScheduleDate’,array(‘prepend’=>’<i class=“icon-calendar”></i>’)); ?>

Can anyone Please Suggest

do this in your form

[color="#9ACD32"]php code:-[/color]

echo $form->textFieldRow($model,‘date’,array(‘class’=>‘datepicker’,‘name’=>‘IncomeDetails[date][]’))

[color="#9ACD32"]js code:-[/color]

var date = new Date();

date.setDate(date.getDate()-1);

$(’.datepicker’).datepicker({

startDate: date

});

:rolleyes:

Hi,

Try this:


<?php echo $form->datepickerRow($model, 'valid_until',array(

                'label' => false,

                'options'=>array('format' => 'dd/mm/yyyy' , 'startDate'=>date("d-m-Y") ,'weekStart'=> 1),

                'placeholder' => 'Valid Until',

                'prepend' => '<i class="icon-calendar"></i>')); 

             ?>

It should disabled past dates on your cal.

Enjoy!

Error: Calling unknown method: yii\widgets\ActiveForm::datepickerRow()

Help?