Date Picker

Date picker provides an interface to easily set dates.


Materialize uses a modified version of Amsul's pickadate.js.
Please refer to the official documentation for details on the options.
To change the options or bind any events you can use $clientOptions and $clientEvents.

Be advised that not all options might be available in the Materialize version.

<?= \macgyer\yii2materializecss\widgetsorm\DatePicker::widget([
    'name' => 'datepicker_example',
    'options' => ['placeholder' => 'Select date'],
    'clientOptions' => [
        'format' => 'yyyy-mm-dd'
]); ?>

<input type="text" id="w0" class="datepicker picker__input picker__input--active" name="datepicker_example" placeholder="Select date" readonly="" tabindex="-1" aria-haspopup="true" aria-expanded="true" aria-readonly="false" aria-owns="w0_root">

Rendered result

Please note:
As this is a JS plugin, the input will be further manipulated by the JS plugin.