2amigos DataRangePicker。显示过输入。

时间:2016-10-17 12:27:52

标签: twitter-bootstrap-3 yii2 yii-widgets bootstrap-daterangepicker

问题

我设定了方向,但它仍然在底部。问题是什么?

代码

<?=$form->field($contactUsModel, 'planningToTravelFrom')
                            ->widget(\dosamigos\datepicker\DateRangePicker::className(), [
                                'attributeTo'   => 'planningToTravelTo',
                                'form'          => $form, // best for correct client validation
                                'language'      => 'es',
                                'size'          => 'lg',
                                'clientOptions' => [
                                    'autoclose'   => true,
                                    'orientation' => 'top',
                                    'format'      => 'dd-M-yyyy'
                                ]
                            ]);?>

enter image description here

1 个答案:

答案 0 :(得分:0)

问题在于

  1. 应为'orientation' => 'bottom'
  2. 不适用于date-range-picker bugfix
  3. $("#contactform-planningtotravelfrom, #contactform-planningtotravelto").datepicker().on('show.bs.modal', function (event) {
            // prevent datepicker from firing bootstrap modal "show.bs.modal"
            event.stopPropagation();
        });