1

I have created a custom module to mark order as delivered , In my ui component file located at app/code/Namespace/Modulename/view/adminhtml/ui_component/namespace_delivery_form.xml

i have the following code

        <field name="pickup_date" formElement="date" sortOrder="10">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">proofofdelivery</item>
            </item>
        </argument>
        <settings>
            <dataType>text</dataType>
            <label translate="true">pickup_date</label>
            <dataScope>pickup_date</dataScope>
            <validation>
                <rule name="required-entry" xsi:type="boolean">false</rule>
            </validation>
        </settings>
    </field>
    <field name="delivery_date" formElement="date" sortOrder="20">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">proofofdelivery</item>
            </item>
        </argument>
        <settings>
            <dataType>text</dataType>
            <label translate="true">delivery_date</label>
            <dataScope>delivery_date</dataScope>
            <validation>
                <rule name="required-entry" xsi:type="boolean">false</rule>
            </validation>
        </settings>
    </field>

i have 2 dates , order pickup date and delivery date , the thing is pickup date and delivery date that the admin select should be greater than the order created date , all previous dates need to be disabled .

i cannot find anywhere , where can i put date-range validation for this ui-component , i also need to fetch order created date which would be different for each order , so need a dynamic solution to the problem .

Thanks

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.