skip to Main Content

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>
</column>

2

Answers


  1. The issue in dateFormat item. Use below code this will work for you.

    <column name="created_at" class="MagentoUiComponentListingColumnsDate">
        <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 dd, YYYY, H:mm:ss A</item>
            </item>
        </argument>
    </column>
    
    Login or Signup to reply.
  2. Use this one instead

    <column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date">
      <settings>
        <filter>dateRange</filter>
        <dataType>date</dataType>
        <label translate="true">Created</label>
      </settings>
    </column>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search