1

I have already added new form field - time picker. When I'm trying to save form, post value is overridden on "Invalid date".

  <field name="flight_hour" formElement="date" sortOrder="40">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">flight</item>
                <item name="options" xsi:type="array">
                    <item name="timeFormat" xsi:type="string">HH:mm</item>
                    <item name="showsTime" xsi:type="boolean">true</item>
                    <item name="timeOnly" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
        <settings>
            <dataType>text</dataType>
            <label translate="true">Flight hour</label>
            <dataScope>flight_hour</dataScope>
            <validation>
                <rule name="required-entry" xsi:type="boolean">false</rule>
            </validation>
        </settings>
    </field>

This is error in my XML or core bug ?

1
  • Have you found any solution for this? i also faced the same issue. Aug 27, 2019 at 11:19

1 Answer 1

0

Try to add this code to the <item> option:

<item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>

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.