Is there a way in kartik DatePicker Yii2 - by which I can disable the dates that are greater than current date?
For example: if today is 14th march 2016 then calendar dates from 15th march 2016 should be disabled.
Thanks :)
Plugin Demo page says "DatePicker widget is a Yii2 wrapper for the Bootstrap DatePicker plugin". So you can use all bootstrap datepicker options in this plugin.It should come under "pluginOptions" as key value pair.
"endDate" => "0d", // Will disable all dates after today.
echo DatePicker::widget([
'type' => DatePicker::TYPE_INPUT,
'pluginOptions' => [
'autoclose'=>true,
'format' => 'dd-M-yyyy',
'endDate' => "0d"
]
]);
Bootstrap Datepicker Doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With