Format Time Widget ActiveForm yii2

Good afternoon I need to format the input of a time type field in the widget active form, my form should be short time without the seconds example 18:30, the field is defined in the table of type time, is there any way to tell it to the widget actiform or model this field is of format "php: h: i".

Thank you very much,

Wilmer.

<?= $form->field($model, ‘turnos008’)->textInput([‘class’ => ‘form-control’]) ?>

I had the same problem and installed the kartik DateControl extension which makes all this super easy. You can format each widget as you render it or globally.

http://demos.krajee.com/datecontrol

so


<?= $form->field($model, 'turnos008')->textInput(['class' => 'form-control']) ?> 

would become something like




 <?= $form->field($model, 'turnos008')->widget(DateControl::classname(),[

    'type'=>DateControl::FORMAT_TIME,

    'options' => [

        'pluginOptions' => [

            'autoclose' => true

        ],

        'options' => ['placeholder' => 'time']

    ]

]) ?>