Issue Bug Resolved

#101516Date type field in FormSetup.yaml triggers a validation error

Grégory Duchesnes 08/01/23, 06:11 updated 09/28/26, 19:10

Description

Add this config in FormSetup.yaml and use it in a form.

TYPO3:
    CMS:
        Form:
            prototypes:
                standard:
                    formElementsDefinition:
                        BirthDate:
                            implementationClassName: TYPO3\CMS\Form\Domain\Model\FormElements\Date
                            renderingOptions:
                                templateName: 'Date'
                            properties:
                                displayFormat: d.m.Y
                                containerClassAttribute: 'col-12 col-lg-6 mb-4'
                                elementClassAttribute: 'text-center'
                                elementErrorClassAttribute: 'is-invalid'
                                fluidAdditionalAttributes:
                                    pattern: '([0-9]{4})-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])'

This triggers the following Validation\Error :

The date "1977-01-01" was not recognized (for format "Y-m-d\TH:i:sP").

Same problem if i create a Class that extends TYPO3\CMS\Form\Domain\Model\FormElements\Date
NB : Use the same config directly in my form with the Date type works as expected

Reviews 2

History 13

  1. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-28T19:10:13+00:00" > 09/28/26, 19:10 </span>

    Applied in changeset commit:814fff28991bf3b55a9e2c1ce828a8819f34a3aa.