2

How can I change the date format to display as dd/mm/yyyy for admin date field?

Currently it is displaying as mm/dd/yyyy format. Can you please help me out?

enter image description here

1

1 Answer 1

0

=> Try to use this date format in your xml file :

<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="filter" xsi:type="string">dateRange</item>
            <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
            <item name="dataType" xsi:type="string">date</item>
            <item name="label" xsi:type="string" translate="true">Created At</item>
            <item name="dateFormat" xsi:type="string">dd-MM-YYYY HH:mm:ss</item>
        </item>
    </argument>
</column>
1
  • This will change only on GRID not on the add/edit form. Commented Feb 13, 2023 at 8:46

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.