Search by

yii2-extensions / time-picker

Stefano Mtangoo

Bootstrap time picker widget for Yii2 with Krajee input, asset and plugin integration.

Package info

github.com/yii2-extensions/time-picker

Documentation

Type:yii2-extension

pkg:composer/yii2-extensions/time-picker

Statistics

Installs: 176

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.0.1 2024-11-05 19:13 UTC

This package is auto-updated.

Last update: 2026-11-11 13:31:55 UTC


README

Yii Framework

TimePicker


PHPUnit Zizmor

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

TimePicker features: Yii2 forms, Bootstrap 3/4/5, time formats, layouts, Krajee integration and bundled assets

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.

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

PHP test matrix Yii 2.0.x Krajee Base Bootstrap Latest Stable Version Total Downloads

Project status

Codecov Quality

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

Follow on X Follow on Facebook Join our Subreddit Join on Telegram

License

License