cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting date on admin page

Formatting date on admin page

Hi

 

I have made an extension to add a field 'delivery_date' on the checkout page.

I would like to display the date on Sales > Orders page.

 

How can we achieve formatting date in UK date format? (dd/mm/YYYY)

My sales_order_grid.xml is like this:

 

<?xml version="1.0" encoding="UTF-8"?>
	<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="delivery_date">
            <argument name="data" xsi:type="array">
                <item name="js_config" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
                </item>
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="align" xsi:type="string">left</item>
                    <item name="dateFormat" xsi:type="string">dd/MM/YYYY</item>
<item name="label" xsi:type="string" translate="true">Delivery Date</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

 

 

 

 

 

Screen Shot 2020-01-08 at 09.png