This is Yii2 widget wrapper for Flatpickr datetime picker. Flatpickr is a lightweight and powerful datetime picker written in vanilla javascript.
The latest stable version of the extension is v2.0
The preferred way to install this extension is through composer.
Either run
$ composer require codenix-sv/yii2-flatpickr:~2.0
or add
"codenix-sv/yii2-flatpickr" : "~2.0"
to the require section of your application's composer.json
file.
<?php
use codenixsv\flatpickr\Flatpickr;
?>
...
<?= $form->field($model, 'date')->widget(Flatpickr::class) ?>
<?= Flatpickr::widget(['model' => $model, 'attribute' => 'email']) ?>
<?php
use codenixsv\flatpickr\Flatpickr;
?>
...
<?= $form->field($model, 'email')->widget(Flatpickr::class, [
'theme' =>'dark',
'clientOptions' => [
'locale' => 'ru',
'enableTime' => true
]
]) ?>
Please, check the Flatpickr site documentation for further information about configuration options.
yii2-flatpickr is released under the MIT License. See the bundled LICENSE for details.