<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\datepicker\DatePicker;

?>

<style>
    h3{
        margin-top: 0px;
    }
</style>

<div class="advanced-search-form">

    <h3><?= Yii::t('app', 'Search By Date Range') ?></h3>

    <?php $form = ActiveForm::begin(['options' => ['id' => 'advanced-search-form', 'autocomplete' => 'off']]); ?>

    <?= $form->field($model, 'from_date')->widget(DatePicker::className(), [
            'language' => Yii::$app->language,
            'clientOptions' => [
                'autoclose' => true,
                'format' => 'yyyy-m-d',
                'todayHighlight' => true,
                'todayBtn' => 'linked'
            ],
            'options' => [
                'id' => 'from-date',
            ]
        ]) ?> 

    <?= $form->field($model, 'to_date')->widget(DatePicker::className(), [
            'language' => Yii::$app->language,
            'clientOptions' => [
                'autoclose' => true,
                'format' => 'yyyy-m-d',
                'todayHighlight' => true,
                'todayBtn' => 'linked'
            ],
            'options' => [
                'id' => 'to-date',
            ]
        ]) ?> 

    <div class="form-group">
        <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>