https://github.com/codenix-sv/yii2-flatpickr
Flatpickr widget for Yii2
https://github.com/codenix-sv/yii2-flatpickr
datetimepicker flatpickr yii2-datepicker yii2-extension yii2-widgets
Last synced: 4 months ago
JSON representation
Flatpickr widget for Yii2
- Host: GitHub
- URL: https://github.com/codenix-sv/yii2-flatpickr
- Owner: codenix-sv
- License: mit
- Created: 2017-11-21T17:47:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-12T08:18:40.000Z (about 3 years ago)
- Last Synced: 2025-06-13T02:50:06.786Z (4 months ago)
- Topics: datetimepicker, flatpickr, yii2-datepicker, yii2-extension, yii2-widgets
- Language: PHP
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flatpickr widget for Yii2
[](https://travis-ci.org/codenix-sv/yii2-flatpickr)
[](https://codeclimate.com/github/codenix-sv/yii2-flatpickr/maintainability)
[](https://codeclimate.com/github/codenix-sv/yii2-flatpickr/test_coverage)
[](https://scrutinizer-ci.com/g/codenix-sv/yii2-flatpickr/?branch=master)
[](https://scrutinizer-ci.com/g/codenix-sv/yii2-flatpickr/?branch=master)[](https://packagist.org/packages/codenix-sv/yii2-flatpickr)
[](https://packagist.org/packages/codenix-sv/yii2-flatpickr)This is Yii2 widget wrapper for [Flatpickr datetime picker](https://github.com/chmln/flatpickr).
Flatpickr is a lightweight and powerful datetime picker written in vanilla javascript.
## Latest release
The latest stable version of the extension is v2.0## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```bash
$ composer require codenix-sv/yii2-flatpickr:~2.0
```
or add```json
"codenix-sv/yii2-flatpickr" : "~2.0"
```to the require section of your application's `composer.json` file.
## Basic usage
### Example of use with an `ActiveForm`:
```php
...
= $form->field($model, 'date')->widget(Flatpickr::class) ?>
```
### Example of use as a widget:
```php
= Flatpickr::widget(['model' => $model, 'attribute' => 'email']) ?>
```## Usage with options
```php...
= $form->field($model, 'email')->widget(Flatpickr::class, [
'theme' =>'dark',
'clientOptions' => [
'locale' => 'ru',
'enableTime' => true
]
]) ?>
```## Further Information
Please, check the [Flatpickr site](https://chmln.github.io/flatpickr/options/) documentation for further
information about configuration options.## License
**yii2-flatpickr** is released under the MIT License. See the bundled [LICENSE](./LICENSE) for details.