2017 © Pedro Peláez
 

yii2-extension yii2-datetimepicker-widget

Bootstrap 3 DateTimePicker widget for Yii2.

image

brussens/yii2-datetimepicker-widget

Bootstrap 3 DateTimePicker widget for Yii2.

  • Wednesday, December 10, 2014
  • by brussens
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,009 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 3 Versions
  • 15 % Grown

The README.md

Bootstrap 3 DateTime Picker widget for Yii2

Latest Stable Version Total Downloads License, (*1)

Install

Either run, (*2)

php composer.phar require --prefer-dist brussens/yii2-datetimepicker-widget "*"

or add, (*3)

"brussens/yii2-datetimepicker-widget": "*"

to the require section of your composer.json file., (*4)

Options

  • format - datetime format
  • clientOptions - options of plugin. See http://eonasdan.github.io/bootstrap-datetimepicker/#options

Base usage:

use brussens\datetimepicker\Widget as DateTimePicker;

echo $form->field($model, 'attribute')->widget(DateTimePicker::className());

Advanced usage

use brussens\datetimepicker\Widget as DateTimePicker;

echo $form->field($model, 'attribute')->widget(DateTimePicker::className(), [
    'format'=>'DD-MM-YYYY HH:mm:ss',
    'clientOptions' => [
        'locale' => 'ru', //If you do not want to use auto-detection
        'icons' => [
            'time' => 'el-icon-time',
            'date' => 'el-icon-calendar',
            'up' => 'el-icon-chevron-up',
            'down' => 'el-icon-chevron-down',
        ],
        'useSeconds' => true,
        'useCurrent' => true,
        'sideBySide' => true
    ],
]);

Range usage (experimentally)

use yii\grid\GridView;
use brussens\datetimepicker\RangeWidget;

GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $model,
    'columns' => [
        //... some columns
        [
            'filter' => RangeWidget::widget([
                'model' => $model,
                'attribute' => 'date_from',
                'attributeTo' => 'date_to'
            ]),
            'attribute' => 'created_at',
            'format' => 'datetime',
        ],
        ['class' => 'yii\grid\ActionColumn'],
    ],
]);

Profit

The Versions

10/12 2014

dev-master

9999999-dev

Bootstrap 3 DateTimePicker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Brusenskiy Dmitry

extension yii widget datepicker datetimepicker timepicker

10/12 2014

1.0.1

1.0.1.0

Bootstrap 3 DateTimePicker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Brusenskiy Dmitry

extension yii widget datepicker datetimepicker timepicker

08/12 2014

1.0.0

1.0.0.0

Bootstrap 3 DateTimePicker widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Brusenskiy Dmitry

extension yii widget datepicker datetimepicker timepicker