擴展是
kartik\datetime\DateTimePicker;
關鍵是加入此配置 'minView'=> "month",示例以下:
<?php
echo DateTimePicker::widget([
'name' => 'dayEnd', 'value' => $request['dayEnd'] ? $request['dayEnd'] : "", 'options' => ['placeholder' => '截止日期','autocomplete'=>'off'], 'pluginOptions' => [ 'autoclose' => true, 'format' => 'yyyy-mm-dd', 'todatHightlight'=>true,
//關鍵配置 'minView'=> "month", ], ]); ?>