0

I have added a DataRange filter like this on a listing ui component:

<column name="fecha_order" sortOrder="20">
            <settings>
                 <filter>dateRange</filter>
                <label translate="true">Fecha</label>
            </settings>
 </column>

Then I get the values here in a custom Data Provider

  public function addFilter(\Magento\Framework\Api\Filter $filter)
    {
        $writer = new \Laminas\Log\Writer\Stream(BP . '/var/log/filters.log');
        $logger = new \Laminas\Log\Logger();
        $logger->addWriter($writer);

        $this->_session->start();
        $this->_session->setFrom($filter->getValue());
        $logger->info($filter->getValue());
        $logger->info($filter->getField());
    }

The only problem is that I'm getting both values like 1 single variable. I get for example: 2021-09-01 05:00:00 2021-09-15 04:59:59

So the method is like executing 2 times.

But I need to get both in a single time because I'm storing it on a Session Variable. I need to create a variable session From and a variable session To How can I achieve that? Thanks and greetings!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.