I would like to specify the date format for a new date field in my CMS page form. I have created a new cms_page_form.xml field which links to a date field in the MySQL database table cms_page. However, MySQL rejects the field because it is in the wrong format. I have tried setting the format in many different ways: https://i.imgur.com/xjtrrYc.png (also without the item options array), literally spending hours trying to set it in cms_page_form.xml with the official documentation for the Date component not providing much of any help: https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-date.html
Here is my cms_page_form.xml with the date formatting not working: https://i.imgur.com/xjtrrYc.png
When I load the CMS page, by default, it displays "Invalid date": https://i.imgur.com/kVv7I2o.png then quickly changes over to today's date - in the wrong format: https://i.imgur.com/OcfoH0E.png
All I want is a date input with the format of yyyy-MM-dd in my CMS page form in Magento 2.4.2
If anyone could help me with this I would really appreciate it.
Add date Format
<column name="run_time" 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="sortOrder" xsi:type="number">60</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">Run Time</item> <item name="dateFormat" xsi:type="string" translate="true">MM/dd/YYYY hh:mm:ss a</item> </item> </argument> </column>
Now delete the records that you find from a ui_bookmark table.
Clear the cache
See more: https://www.screencast.com/t/qePBLRpe27
Nope, that didn't help, I'm still experiencing the problem I posted about.