twitter-bootstrap-3yii2yii-widgetsbootstrap-daterangepicker

2amigos DataRangePicker. Display over input.


Problem

I set orientation, but it's still at the bottom. What's the problem?

Code

<?=$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


Solution

  • Problem was in

    1. Should be 'orientation' => 'bottom'
    2. Not works with date-range-picker bugfix

     

    $("#contactform-planningtotravelfrom, #contactform-planningtotravelto").datepicker().on('show.bs.modal', function (event) {
            // prevent datepicker from firing bootstrap modal "show.bs.modal"
            event.stopPropagation();
        });