yii2-extensions / time-picker
Bootstrap time picker widget for Yii2 with Krajee input, asset and plugin integration.
Package info
github.com/yii2-extensions/time-picker
Type:yii2-extension
pkg:composer/yii2-extensions/time-picker
Requires
- kartik-v/yii2-krajee-base: >=2.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-11 13:31:55 UTC
README
TimePicker
Bootstrap time picker for Yii2 forms
Standalone and model-bound inputs, configurable time formats, and Krajee asset integration
Select a time with the mouse or keyboard arrow keys. This extension retains Kartik Visweswaran's Krajee widget, wrapping rendom's TimePicker plugin, forked from jdewit's TimePicker.
Features
Quick start
Installation
Install with Composer and the Bootstrap integration matching your application. For Bootstrap 3:
composer require yii2-extensions/time-picker yiisoft/yii2-bootstrap
The application must provide Yii and resolve its Bower assets. See the installation guide for
asset repository configuration, Bootstrap 4/5, matching bsVersion settings and icons. Bootstrap 4/5 requires separate
Font Awesome assets or custom icons; TimePicker does not install Font Awesome.
Applications using Krajee Base 2.x must upgrade to 3.x. See the upgrade notes and Composer metadata. The development baseline is Yii 2.0; Yii 22 compatibility is not established.
Basic usage
Render a standalone input:
use yii\helpers\Html; use Yii2\Extensions\TimePicker\TimePicker; echo Html::label('Start time', 'start-time'); echo TimePicker::widget( [ 'name' => 'start_time', 'value' => '11:24 AM', 'options' => ['id' => 'start-time'], 'pluginOptions' => [ 'showSeconds' => true, ], ], );
Or bind the widget to a model attribute inside an existing ActiveForm:
use Yii2\Extensions\TimePicker\TimePicker; echo $form ->field($model, 'start_time') ->widget( TimePicker::class, [ 'pluginOptions' => [ 'showMeridian' => false, 'defaultTime' => false, ], ] );
Documentation
Practical guides and usage examples for time inputs, Bootstrap integration and Krajee configuration.
- Installation guide: Composer, Bootstrap assets, icons and compatibility.
- Configuration guide: widget options, addons, events and asset overrides.
- Usage examples: standalone inputs and model-bound forms.
- Testing guide: PHPUnit, quality checks and verification limits.
- Upgrade notes: requirements and migration steps.
- Changelog: current work and historical release changes.
AI assistance
AI agents: start with the repository guides, the source PHPDoc in src/ and the
changelog. Verify inherited APIs against the installed Krajee version before suggesting configuration
changes. Keep the Yii2\Extensions\TimePicker namespace and the documented compatibility requirements.
Package information
Project status
Special thanks
Originally developed by Kartik Visweswaran as Krajee TimePicker. Stefano Mtangoo adapted the extension for Yii2 Extensions. The upstream copyright and BSD-3-Clause terms remain in LICENSE.md.