Search by

yii2-extensions / time-picker

Stefano Mtangoo

Bootstrap time picker widget for Yii2 with canonical form submission.

Package info

github.com/yii2-extensions/time-picker

Documentation

Language:JavaScript

Type:yii2-extension

pkg:composer/yii2-extensions/time-picker

Statistics

Installs: 185

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

2.0.0 2026-11-22 01:14 UTC

This package is auto-updated.

Last update: 2026-11-26 20:55:16 UTC


README

Yii Framework

TimePicker


PHPUnit Coverage Mutation Testing PHPStan

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.

Studio booking form with the start time picker open, a 24-hour end time field, and both submitted values in HH:mm:ss

Features

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

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.

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-picker skill: 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

PHP Yii 2.0.55+ Yii 22.0.x Bootstrap Latest Stable Version Total Downloads

Project status

PHPStan Level Max Quality

Security

OpenSSF Scorecard Zizmor

Built with AI

Built with Claude Code Built with Codex Reviewed by CodeRabbit

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

The bundled Bootstrap Timepicker JavaScript and CSS also carry Joris de Wit's MIT notice.