Skip to content
This repository

[Validator] Date validator converts DateTime object to string #6771

Closed
fkrauthan opened this Issue January 16, 2013 · 2 comments

2 participants

Florian Krauthan Jakub Zalas
Florian Krauthan

It looks like that the Date validator in sf 2.1.6 changes the content of a model. If i have something like this:

    /**
     * @ORM\Column(name="release_date", type="date")
     *
     * @Assert\Date()
     */
    protected $releaseDate;

The $releaseDate within my object has the type string after validation. If I remove @Assert\Date() the type of $releaseDate is a DateTime. So it looks like that the Date validator change the content and type of a Model and dose not only act as read only for validation.

Jakub Zalas
Collaborator

@fkrauthan I can't reproduce it. Did you use the validator directly or with a form? If you've used a form what's the field type for $releaseDate in your form?

Florian Krauthan

I was using $builder->add('releaseDate'); within my Form type. But I am not sure if that's still an issue. I am now with sf 2.3. I guess we can close that ticket and If I see something like that again I will create a new ticket.

Florian Krauthan fkrauthan closed this December 09, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.