Date Picker
Date picker provides an interface to easily set dates.
Configuration
To change the options or bind any events you can use $clientOptions
and $clientEvents
.
<?= \macgyer\yii2materializecss\widgets\form\DatePicker::widget([
'name' => 'datepicker_example',
'options' => ['placeholder' => 'Select date'],
'clientOptions' => [
'format' => 'yyyy-mm-dd',
'setDefaultDate' => true,
]
]); ?>
Rendered result
Please note:
As this is a JS plugin, the input will be further manipulated by the JS plugin.