simialbi / yii2-widget-datetimepicker
yii2 widget based on tempus dominus
Installs: 825
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 4
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.3
- bower-asset/tempusdominus-bootstrap-4: ^5.1.0
- simialbi/yii2-simialbi-base: >=0.10.2 <1.0 | ^1.0.0
- yiisoft/yii2: ^2.0.23
- yiisoft/yii2-bootstrap4: ^2.0.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-22 17:35:16 UTC
README
This extension provides a date
, time
or datetime
picker widget for yii2 framework in Bootstrap 4 style. It's based
on Tempus Dominus.
Resources
- yii2 framework
- Tempus Dominus
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require --prefer-dist simialbi/yii2-widget-datetimepicker
or add
"simialbi/yii2-widget-datetimepicker": "~2.0"
to the require
section of your composer.json
Example Usage
To include datepicker instance in one of your pages, call the widget like this:
<?php /* @var $this yii\web\View */ /* @var $model yii\base\Model */ use yii\widgets\ActiveForm; use simialbi\yii2\date\Datetimepicker; $this->title = 'myForm'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="my-form"> <?php $form = ActiveForm::begin(['id' => 'my-form']); ?> <?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?> <?= $form->field($model, 'birthday')->widget(Datetimepicker::class, [ 'format' => 'mm/dd/yyyy', 'type' => Datetimepicker::TYPE_COMPONENT_APPEND ]) ?> <?= $form->field($model, 'email') ?> <?php ActiveForm::end(); ?> </div>
License
yii2-widget-datetimepicker is released under MIT license. See bundled LICENSE for details.