Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Unwanted Validation on DateTime Type #7182

Copy link
Copy link
Closed
@raphpar

Description

@raphpar
Issue body actions

Hi there,

I have notice that for a datetime Type, an automatic validation is done after form submiting.
I splitted my field like this:

$builder->add('matchDate', 'datetime', array(                   
    'required' => false, 
    'invalid_message' => 'Hello',
    'date_format' => 'dd/MM/yyyy', 
    'date_widget' => 'single_text', 
    'time_widget' => 'choice'
))                  

If I put for example "02/35/2013" in my matchDate.date field, I get an error on the matchDate field with "This value is not valid".

I looked in Symfony\Component\Validator\Constraints\Date.php, Symfony\Component\Validator\Constraints\Time.php, Symfony\Component\Validator\Constraints\DateTime.php and anywhere I could find this error message.

On my entity I have no validation constraints set. Did anyone notice the same behavior on this application ?
In fact, it's not a problem that the validation is done, it's more the unposibility to change the error message even in setting the 'invalid_message' option.

Thanks in advance for you help.

By the way, I'm actualy working on 2.2.0BETA1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.