yii2-extensions/time-picker

Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets)

1.0.1 2024-11-05 19:13 UTC

This package is auto-updated.

Last update: 2024-11-05 19:16:14 UTC


README

The TimePicker widget allows you to easily select a time for a text input using your mouse or keyboards arrow keys. The widget is a wrapper enhancement of the TimePicker plugin by rendom forked from jdewit's TimePicker. This widget as used here has been specially enhanced for Yii framework 2.0 and Bootstrap 3. With release v1.0.4, the extension has been enhanced to support Bootstrap 4.x version.

Installation

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

To install, either run

composer require yii2-extensions/time-picker "^1.0"

or add

"yii2-extensions/time-picker": "*"

to the require section of your composer.json file.

Release Changes

NOTE: Refer the CHANGE LOG for details on changes to various releases.

Usage

use Yii2\Extensions\TimePicker\TimePicker;

// usage without model
echo '<label>Start Time</label>';
echo TimePicker::widget([
    'name' => 'start_time', 
    'value' => '11:24 AM',
    'pluginOptions' => [
        'showSeconds' => true
    ]
]);

or in a form

<?= $form->field($model, 'start_time')->widget(TimePicker::class, [
    'pluginOptions' => [
        'showMeridian' => false,
        'defaultTime' => null
    ]
]); ?>

License

time-picker extension is released under the BSD-3-Clause License. See the bundled LICENSE.md for details.