0

I want to save it in date field no another field and not a new item

https://i.stack.imgur.com/0icp0.jpg

Example of the outcome I am looking for

  • hi, here am adding date with time at cart price rules form, i want to add time how to add it, can you help. Thanks in advance – Praveen Negimani Feb 14 '19 at 13:06
1

app/app/code/SR/MagentoCommunity/view/adminhtml/ui_component/sales_rule_form.xml


<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="rule_information" sortOrder="10">
        <field name="from_date" formElement="date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="options" xsi:type="array">
                        <item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
                        <item name="timeFormat" xsi:type="string">HH:mm:ss</item>
                        <item name="showsTime" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
        <field name="to_date" formElement="date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="options" xsi:type="array">
                        <item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
                        <item name="timeFormat" xsi:type="string">HH:mm:ss</item>
                        <item name="showsTime" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>
  • @Sohel Rana Thank you so much for replaying , that is working , thank you – Praveen Negimani Feb 15 '19 at 4:23
  • but Magento 2 not validating that, it showing error that Enter Valid Date, i changed database column as DATETIME, still its not submitting – Praveen Negimani Feb 15 '19 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.