echo $form->field(
$modelLeg,
"[{$i}]StartDt",
[
'options' => ['class' => 'table-control'],
'template' => '<div class="">{input}</div>'."\n".'<div class="">{hint}{error}</div>'
]
)
->widget(
DateTimePicker::className(), [
'type' => DateTimePicker::TYPE_INPUT,
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy-mm-dd hh:ii',
'todayHighlight' => true,
]
]
);
'formatter' => [
'class' => 'yii\i18n\Formatter',
'dateFormat' => 'yyyy-MM-dd', //'php:Y-m-d',
'timeFormat'=>'HH:mm', //php:H:i',
'datetimeFormat'=>'yyyy-MM-dd HH:mm', //'php:Y-m-d H:i',
'currencyCode' => '$',
'decimalSeparator' => '.',
'thousandSeparator' => ',',
],
echo $form->field(
$modelLeg,
"[{$i}]StartDt",
[
'options' => ['class' => 'table-control'],
// 'inputOptions' => ['enableLabel' => false,]
// 'inputOptions' => ['value' => \Yii::$app->formatter->asDatetime($modelLeg->StartDt, 'M/d/Y')],
'template' => '<div class="">{input}</div>'."\n".'<div class="">{hint}{error}</div>',
]
)
but it doesn't work and I think this has to do with the dynamic form attribute not being StartDt but rather [{$i}]StartDt. However, I can't get it to accept any of the variations I've attempted.Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.