Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhuravljov/yii2-datetime-widgets
Datetime widgets for Yii2
https://github.com/zhuravljov/yii2-datetime-widgets
datepicker daterangepicker datetimepicker widget yii2
Last synced: 2 months ago
JSON representation
Datetime widgets for Yii2
- Host: GitHub
- URL: https://github.com/zhuravljov/yii2-datetime-widgets
- Owner: zhuravljov
- License: bsd-3-clause
- Created: 2014-02-01T13:15:11.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-08-09T23:02:55.000Z (over 7 years ago)
- Last Synced: 2024-10-11T21:55:21.190Z (3 months ago)
- Topics: datepicker, daterangepicker, datetimepicker, widget, yii2
- Language: PHP
- Homepage:
- Size: 263 KB
- Stars: 21
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Datetime widgets for Yii2
=========================[![Latest Stable Version](https://poser.pugx.org/zhuravljov/yii2-datetime-widgets/version.svg)](https://packagist.org/packages/zhuravljov/yii2-datetime-widgets)
[![Total Downloads](https://poser.pugx.org/zhuravljov/yii2-datetime-widgets/downloads.png)](https://packagist.org/packages/zhuravljov/yii2-datetime-widgets)Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Add
```
"zhuravljov/yii2-datetime-widgets" : "~1.1.0"
```to the require section of your application's `composer.json` file.
DatePicker
----------[Demo](https://uxsolutions.github.io/bootstrap-datepicker) from the bootstrap-datepicker plugin website.
### Usage
```php
= $form->field($model, 'attribute')->widget(DatePicker::class, [
'clientOptions' => [
'format' => 'dd.mm.yyyy',
'language' => 'ru',
'autoclose' => true,
'todayHighlight' => true,
],
'clientEvents' => [],
]) ?>
```DateTimePicker
--------------[Demo](http://www.malot.fr/bootstrap-datetimepicker/demo.php) from the bootstrap-datetimepicker plugin website.
### Usage
```php
= $form->field($model, 'attribute')->widget(DateTimePicker::class, [
'clientOptions' => [
'format' => 'dd.mm.yyyy hh:ii',
'language' => 'ru',
'autoclose' => true,
],
'clientEvents' => [],
]) ?>
```DateRangePicker
---------------[Demo](http://www.daterangepicker.com) from the bootstrap-daterangepicker plugin website.
### Usage
```php
= $form->field($model, 'actual_time')->widget(DateRangePicker::class, [
'clientOptions' => [
'locale' => [
'format' => 'YYYY-MM-DD',
'separator' => ' - ',
],
'ranges' => [
'Today' => [
new JsExpression('moment()'),
new JsExpression('moment()'),
],
'Yesterday' => [
new JsExpression('moment().subtract(1, "days")'),
new JsExpression('moment().subtract(1, "days")'),
],
],
],
'clientEvents' => [],
]) ?>
```