I want to change the date format for admin in Sales->Order(view order)->Invoices tab in 24H format
I tried to find how this grid is rendered and i found(with template path hinth) that this table is rendered in vendor\magento\module-ui\view\base\ui_component\templates\listing\default.xhtml
.
<div
class="admin__data-grid-outer-wrap"
data-bind="scope: '{{getName()}}.{{getName()}}'"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../Ui/etc/ui_template.xsd">
<div data-role="spinner" data-component="{{getName()}}.{{getName()}}.{{spinner}}" class="admin__data-grid-loading-mask">
<div class="spinner">
<span/><span/><span/><span/><span/><span/><span/><span/>
</div>
</div>
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
And from here some KO js files are loaded.
I am not god at KO js and I don't know how can I do this?
Does anyone know how can I change this date format?
Best Answer
To change any date to 24 format in SALES menu:
override
/vendor/magento/module-sales/view/adminhtml/ui_component/
xml that you need and add:<item name="dateFormat" xsi:type="string">MMM dd, YYYY, HH:mm:ss </item>
for the date filed.As an example: