faryshta/yii2-clockpicker

Yii2 wrapper for clockpicker (clock-like time picker) plugin

Installs: 7 931

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 5

Open Issues: 2

Type:yii2-extension

1.0.0 2016-01-22 00:17 UTC

This package is not auto-updated.

Last update: 2024-12-21 19:47:42 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Bootstrap and Jquery Yii2 widgets for clockpicker (clock-like time picker) jquery plugin

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist "faryshta/yii2-clockpicker:*"

or add

"faryshta/yii2-clockpicker": "*"

to the require section of your composer.json file.

If you want to use the Bootstrap ClockPicker you need to include the yiisoft/yii2-bootstrap extension

composer require --prefer-dist "yiisoft/yii2-bootstrap:*"

or add

"yiisoft/yii2-bootstrap": "*"

Usage

Jquery

In the view file register the asset:

use farystha\widgets\JqueryClockPicker;


// with ActiveForm
echo $form->field($model, 'attribute')->widget(JqueryClockPicker::className() [
    // extra configuration
]);

// without ActiveForm and with model.
echo JqueryClockPicker::widget([
    'model' => $person,
    'attribute' => 'gender',
]);

Bootstrap

In the view file register the asset:

use farystha\widgets\BootstrapClockPicker;


// with ActiveForm
echo $form->field($model, 'attribute')->widget(BootstrapClockPicker::className() [
    // extra configuration
]);

// without ActiveForm and with model.
echo BootstrapClockPicker::widget([
    'model' => $person,
    'attribute' => 'gender',
]);

Documentation

This library doesn't define anything new, the widgets classes are very similar to the class \yii\bootstrap\Widget which can be used as documentation for the widget classes.

The JS options can be passed using the $clientOptions property and the events can be declared using the $clientEvents property. The documentation on all the options and events supported by clockpicker can be found here.

License

The BSD License (BSD). Please see License File for more information.