Magento 2 : Listing component

Posted . Visible to the public.

Date columns with date formatting

Following example shows how to use date component in listing

In xml

<column name="due_date" class="Magento\Ui\Component\Listing\Columns\Date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Due Date</item>
                    <item name="timezone" xsi:type="string">false</item>
                    <item name="dataType" xsi:type="string">date</item>
                    <item name="filter" xsi:type="string">dateRange</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
                    <item name="sortOrder" xsi:type="number">60</item>
                    <item name="skipTimeZoneConversion" xsi:type="string">true</item>
                    <item name="dateFormat" xsi:type="string">MMM d, y</item>
                </item>
            </argument>
        </column>

vasan
Last edit
vasan
Posted by vasan to vasan's deck (2022-03-25 02:43)