src/DateRangePicker.php
protected function registerClientScript()
    {
        $view = $this->getView();

        DateRangePickerAsset::register($view);

        $id = $this->options['id'];

        $options = Json::encode($this->clientOptions);
        $startInputId = Json::encode('#'.Html::getInputId($this->model, $this->start_attribute));
        $endInputId = Json::encode('#'.Html::getInputId($this->model, $this->end_attribute));

        $fn = new JsExpression(<<<JS
function(ev, picker) {
    elS.val(picker.startDate.format('YYYY-MM-DD'));
    elE.val(picker.endDate.format('YYYY-MM-DD'));
}
JS
);
        $selector = Json::encode($this->parentSelectorHide);
        $view->registerJs(<<<JS
(function () {
    var elS = $($startInputId),
        elE = $($endInputId);
    jQuery('#$id')
        .daterangepicker($options)
        .on('apply.daterangepicker', $fn);

    elS.parents($selector).hide();
    elE.parents($selector).hide();
})();
JS
);

    }
protected function registerClientScript()
    {
        $view = $this->getView();

        DateRangePickerAsset::register($view);

        $id = $this->options['id'];

        $options = Json::encode($this->clientOptions);
        $startInputId = Json::encode('#'.Html::getInputId($this->model, $this->start_attribute));
        $endInputId = Json::encode('#'.Html::getInputId($this->model, $this->end_attribute));

        $fn = new JsExpression(<<<JS
function(ev, picker) {
    elS.val(picker.startDate.format('YYYY-MM-DD'));
    elE.val(picker.endDate.format('YYYY-MM-DD'));
}
JS
);
        $selector = Json::encode($this->parentSelectorHide);
        $view->registerJs(<<<JS
(function () {
    var elS = $($startInputId),
        elE = $($endInputId);
    jQuery('#$id')
        .daterangepicker($options)
        .on('apply.daterangepicker', $fn);

    elS.parents($selector).hide();
    elE.parents($selector).hide();
})();
JS
);

    }
Registers wysihtml5 plugin and the related events