Project

General

Profile

Actions

Bug #101516

open

Date type field in FormSetup.yaml triggers a validation error

Added by Grégory Duchesnes 12 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
Start date:
2023-08-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

No data to display

Actions

Also available in: Atom PDF