2017 © Pedro Peláez
 

yii2-extension yii2-timepicker

Yii 2 widget for jQuery Timepicker Addon.

image

janisto/yii2-timepicker

Yii 2 widget for jQuery Timepicker Addon.

  • Thursday, November 12, 2015
  • by janisto
  • Repository
  • 4 Watchers
  • 6 Stars
  • 17,371 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 4 Versions
  • 8 % Grown

The README.md

Yii 2 Timepicker

Yii 2 widget for jQuery Timepicker Addon., (*1)

Software License Build Status Quality Score Packagist Version Total Downloads, (*2)

Installation

If you do not have Composer, you may install it by following the instructions at getcomposer.org., (*3)

You can then install this package using the following command:, (*4)

php composer.phar require "janisto/yii2-timepicker" "*"

or add, (*5)

"janisto/yii2-timepicker": "*"

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

Usage

See jQuery Timepicker options., (*7)

For example to use the timepicker with a yii\base\Model:, (*8)

echo TimePicker::widget([
     //'language' => 'fi',
    'model' => $model,
    'attribute' => 'created_at',
    'mode' => 'datetime',
    'clientOptions' => [
        'dateFormat' => 'yy-mm-dd',
        'timeFormat' => 'HH:mm:ss',
        'showSecond' => true,
    ]
]);
echo TimePicker::widget([
    //'language' => 'fi',
    'model' => $model,
    'attribute' => 'created_at',
    'mode' => 'datetime',
    'inline' => true,
    'clientOptions' => [
        'onClose' => new \yii\web\JsExpression('function(dateText, inst) { console.log("onClose: " + dateText); }'),
        'onSelect' => new \yii\web\JsExpression('function(dateText, inst) { console.log("onSelect: " + dateText); }'),
    ]
]);

The following example will use the name property instead:, (*9)

echo TimePicker::widget([
     //'language' => 'fi',
    'name'  => 'from_time',
    'value'  => $value,
    'mode' => 'time',
    'clientOptions' => [
        'hour' => date('H'),
        'minute' => date('i'),
        'second' => date('s'),
    ]
]);

You can also use this widget in an yii\widgets\ActiveForm using the yii\widgets\ActiveField::widget() method, for example like this:, (*10)

echo $form->field($model, 'field')->widget(\janisto\timepicker\TimePicker::className(), [
    //'language' => 'fi',
    'mode' => 'datetime',
    'clientOptions' => [
        'dateFormat' => 'yy-mm-dd',
        'timeFormat' => 'HH:mm:ss',
        'showSecond' => true,
    ]
]);

Contributing

Please see CONTRIBUTING for details., (*11)

Credits

License

Public domain. Please see License File for more information., (*12)

The Versions

12/11 2015

dev-master

9999999-dev https://github.com/janisto/yii2-timepicker

Yii 2 widget for jQuery Timepicker Addon.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension yii2 date widget timepicker time datetime

12/11 2015

1.1.0

1.1.0.0 https://github.com/janisto/yii2-timepicker

Yii 2 widget for jQuery Timepicker Addon.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension yii2 date widget timepicker time datetime

26/06 2015

1.0.0

1.0.0.0 https://github.com/janisto/yii2-timepicker

Yii 2 widget for jQuery Timepicker Addon.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension yii2 date widget timepicker time datetime

26/03 2015

0.1.0

0.1.0.0 https://github.com/janisto/yii2-timepicker

Yii 2 widget for jQuery Timepicker Addon.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension yii2 date widget timepicker time datetime