yii2-extensions / time-picker
Bootstrap time picker widget for Yii2 with canonical form submission.
Package info
github.com/yii2-extensions/time-picker
Language:JavaScript
Type:yii2-extension
pkg:composer/yii2-extensions/time-picker
Requires
- php: >=8.3
- yiisoft/yii2: ~2.0.55 || ^22.0@dev
Requires (Dev)
- infection/infection: ^0.35
- maglnet/composer-require-checker: ^4.17
- php-forge/coding-standard: ^0.3.4
- phpstan/phpstan: ^2.3.5
- phpunit/phpunit: ^12.5
Suggests
- yiisoft/yii2-bootstrap: Optional Bootstrap 3 asset integration for Yii 2.0.
- yiisoft/yii2-bootstrap4: Optional Bootstrap 4 asset integration for Yii 2.0.
- yiisoft/yii2-bootstrap5: Optional Bootstrap 5 asset integration for Yii 2.0.
- yiisoft/yii2-jquery: Provides Yii 22 client script strategies for ActiveForm and other Yii widgets.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-26 20:55:16 UTC
README
TimePicker
Bootstrap time picker for Yii2 forms
Standalone and model-bound inputs, configurable display formats, and canonical form submission
Select a time with the mouse or keyboard arrow keys. This extension grew out of Kartik Visweswaran's Krajee widget, which wrapped rendom's TimePicker plugin, forked from jdewit's TimePicker.
Features
Quick start
Installation
Install with Composer:
composer require yii2-extensions/time-picker:^2.0
Load the Bootstrap CSS that matches your application's bsVersion. On Yii 2.0.55, you can use an installed Yii
Bootstrap asset adapter; on Yii 22, provide the Bootstrap CSS and npm jQuery assets in the application. See the
installation guide and
upgrade notes.
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 canonical form submission.
- ๐ Installation Guide
- โ๏ธ Configuration Guide
- ๐ก Usage Examples
- ๐ Upgrade Guide
- ๐งช Testing Guide
The guides and the API reference generated
from the PHPDoc in src/ are published at https://yii2-framework.github.io/docs/extensions/time-picker/.
AI assistance
AI agents: read the documentation index and fetch the Markdown version
of a page by appending index.md to its URL. The
AI agents guide covers skill installation, client setup and
verification.
- ๐ค
yii2-time-pickerskill: configure Bootstrap markup, icons, and plugin options; verify submitted time values and form behavior.
See the repository guides, the skill source, the source PHPDoc, and the changelog. Check the guides against the installed revision before applying examples.
Package information
Project status
Security
Built with AI
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.
Our social networks
License
The bundled Bootstrap Timepicker JavaScript and CSS also carry Joris de Wit's MIT notice.