DateRangePicker in DetailView. Shows current date instead of earlier saved dates.

Web Tips Q & ACategory: Krajee Yii2 ExtensionsDateRangePicker in DetailView. Shows current date instead of earlier saved dates.
jk87 asked 1 year ago

Hi Kartik,
I’m trying to use your DateRangePicker in your DetailView Widget. It works fine and I’m able to save the selected dates, but when I’m trying to edit the date range, it shows only the current date. My code and a screenshot of the problem are below.

    [
'columns' => [
[
'attribute' => 'datum',
'value' => $planning->datum .' tot '.$planning->datum_tot,
'label' => 'Van',
'type' => DetailView::INPUT_WIDGET,
'widgetOptions' => [
'class' => DateRangePicker::classname(),
'useWithAddon' => true,
'hideInput' => true,
'startAttribute' => 'datum',
'endAttribute' => 'datum_tot',

'pluginOptions'=> [
'locale'=> ['separator' => ' tot '],
],
],
'labelColOptions' => ['style' => 'width:20%; text-align: right;', 'class' => 'datum_tot'],
'valueColOptions' => ['style' => 'width:80%;', 'class' => 'datum_tot']
],
],
],




Login or register to contribute or comment.

Login   Register