在 Yii2 DatePicker 小部件中隐藏历史下拉选择值

Hide historical dropdown selected value in Yii2 DatePicker widget

如何在 Yii2 kartik select2 中隐藏历史下拉列表? 这是我的源代码:

<div class="col-sm-offset-2 col-sm-10" style="margin-left:135px;margin-bottom:15px">
<label class="control-label">Range Perjalanan Dinas</label>
    <?= DatePicker::widget([
    'type' => DatePicker::TYPE_RANGE,
    'model' => $model,
    'attribute' => 'tgl_mulai',
    'attribute2' => 'tgl_selesai',
    'options' => ['placeholder' => 'Start date'],
    'options2' => ['placeholder' => 'End date'],

    'form' => $form,
    'pluginOptions' => [
        'format' => 'dd-mm-yyyy',
        'autoclose' => true,
    ]
]); ?>
</div>

您可能需要关闭表单元素中的自动完成功能

Turning off form autocomplete

在日期选择器选项中尝试'autocomplete' => 'off'

<?= DatePicker::widget([
        'type' => DatePicker::TYPE_RANGE,
        'model' => $model,
        'attribute' => 'tgl_mulai',
        'attribute2' => 'tgl_selesai',
        'options' => ['placeholder' => 'Start date','autocomplete' => 'off'],
        'options2' => ['placeholder' => 'End date'],

        'form' => $form,
        'pluginOptions' => [
            'format' => 'dd-mm-yyyy',
            'autoclose' => true,
        ]
    ]); ?>