2

In magento 2 sales order grid default date purchase filter is there, but i want to filter with date and time both. please help me how to do.

I tried like below but i didn't get any solution.

Thanks

<column name="created_at" class="Magento_Ui/Component/Listing/Columns/Date">
<argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="timezone" xsi:type="boolean">false</item>
        <item name="filter" xsi:type="string">dateRange</item>
        <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
        <item name="label" xsi:type="string" translate="true">Created</item>
        <item name="dateFormat" xsi:type="string">MMM d</item>
        <item name="options" xsi:type="array">
        <item name="showsTime" xsi:type="boolean">true</item>
        </item>
    </item>
</argument>

1 Answer 1

-1

Please follow given url to add new column in sales order grid : https://belvg.com/blog/how-to-add-column-in-sales-order-grid-in-magento-2-1.html

OR

you can use below code in _prepareColumns().

$this->addColumn('shipped_date', array(
      'header'    => Mage::helper('sales')->__('Shipped Date'),
      'index'     => 'entity_id',
      'type'      => 'datetime',
      'renderer'  => 'Mage_Adminhtml_Block_Sales_Order_Renderer_ShippedDate',
      'filter_condition_callback'
                                       => array($this, '_filterShippedDate'),

));
3
  • he doesn't want column, he needs filter, please read once again. Dec 27, 2017 at 7:31
  • also, magento2 not m1. Dec 27, 2017 at 7:32
  • thanks for this answer, so bad because it not what the question want, but its what i'm looking for, LOL, so thank you :)
    – fudu
    Aug 7, 2018 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.