, (*1)
, (*2)
This is Yii2 widget wrapper for Flatpickr datetime picker.
Flatpickr is a lightweight and powerful datetime picker written in vanilla javascript., (*3)
, (*4)
Latest release
The latest stable version of the extension is v2.0, (*5)
Installation
The preferred way to install this extension is through composer., (*6)
Either run, (*7)
$ composer require codenix-sv/yii2-flatpickr:~2.0
or add, (*8)
"codenix-sv/yii2-flatpickr" : "~2.0"
to the require section of your application's composer.json
file., (*9)
Basic usage
...
= $form->field($model, 'date')->widget(Flatpickr::class) ?>
= Flatpickr::widget(['model' => $model, 'attribute' => 'email']) ?>
Usage with options
...
= $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., (*10)
License
yii2-flatpickr is released under the MIT License. See the bundled LICENSE for details., (*11)