2017 © Pedro Peláez
 

yii2-extension yii2-datetime-widgets

Datetime widgets for Yii2.

image

mitalcoi/yii2-datetime-widgets

Datetime widgets for Yii2.

  • Thursday, September 17, 2015
  • by mitalcoi
  • Repository
  • 0 Watchers
  • 0 Stars
  • 923 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Datetime widgets for Yii2

Installation

The preferred way to install this extension is through composer., (*1)

Add, (*2)

"mitalcoi/yii2-datetime-widgets" : "dev-master"

to the require section of your application's composer.json file., (*3)

DatePicker

Demo from the bootstrap-datepicker plugin website., (*4)

Usage

use mitalcoi\widgets\DatePicker;
<?= $form->field($model, 'attribute')->widget(DatePicker::className(), [
    'options' => ['class' => 'form-control'],
    'clientOptions' => [
        'format' => 'dd.mm.yyyy',
        'language' => 'ru',
        'autoclose' => true,
        'todayHighlight' => true,
    ],
]) ?>

For more details, please check the bootstrap-datepicker plugin website., (*5)

DateTimePicker

Demo from the bootstrap-datetimepicker plugin website., (*6)

Usage

use mitalcoi\widgets\DateTimePicker;
<?= $form->field($model, 'attribute')->widget(DateTimePicker::className(), [
    'options' => ['class' => 'form-control'],
    'clientOptions' => [
        'format' => 'dd.mm.yyyy hh:ii',
        'language' => 'ru',
        'autoclose' => true,
    ],
]) ?>

For more details, please check the bootstrap-datetimepicker plugin website., (*7)

DateRangePicker

Demo from the bootstrap-daterangepicker plugin website., (*8)

Usage

use mitalcoi\widgets\DateRangePicker;
<?= $form->field($model, 'actual_time')->widget(DateRangePicker::className(), [
    'options' => ['class' => 'form-control'],
    'clientOptions' => [
        'ranges' => [
            'Today' => [
                new JsExpression('moment()'),
                new JsExpression('moment()'),
            ],
            'Yesterday' => [
                new JsExpression('moment().subtract("days", 1)'),
                new JsExpression('moment().subtract("days", 1)'),
            ],
        ],
        'format' => 'DD.MM.YYYY',
        'separator' => ' - ',
    ],
]) ?>

For more details, please check the bootstrap-daterangepicker plugin repo., (*9)

The Versions

17/09 2015

dev-master

9999999-dev https://github.com/mitalcoi/yii2-datetime-widgets

Datetime widgets for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sorokin Victor

extension yii widget datepicker datetimepicker daterangepicker