I update the Form component but I still don't get the error displayed but 
the year also doesn't show up in the fields. Note that above I mixed up the 
types. "dob" is the DateField and "cre_date" is the DateTimeField. For 
reference here is the current setup:

Values in the database for the user I'm testing with:
          dob: 2006-10-10
     cre_date: 2007-10-11 14:15:00

Template:
            <tr>
                <th>{{ form_label(userform.dob) }}</th>
                <td>{{ form_field(userform.dob) }} {{ 
form_errors(userform.dob) }}</td>
            </tr>
            <tr>
                <th>{{ form_label(userform.cre_date) }}</th>
                <td>{{ form_field(userform.cre_date) }} {{ 
form_errors(userform.cre_date) }}</td>
            </tr>

Form field definition:
        $this->add(new DateField('dob', array('required' => false)));
        $this->add(new DateTimeField('cre_date', array('required' => 
false)));

Result in the application:
  Dob: <Oct> <10>, <empty year field>
  Cre date: <Oct> <10>, <empty year field> <00>:<00>

Three observations:
1) The year fields are empty
2) Cre date show Oct 10th even though the value in the database is Oct 11th
3) Cre date doesn't show the correct time

Point 2 actually makes me believe that the value from the dob field is 
somehow bleeding into the credate field because when I change the form 
definition to this:
        $this->add(new DateField('dob', array('required' => false,'widget' 
=> 'input')));
        $this->add(new DateTimeField('cre_date', array('required' => 
false)));

I get a completely different output:
  Dob: <Oct 10, 2006>
  Cre date: <Oct> <11>, <2007> <14>:<15>

Again notice that:
1) The years are now correctly displayed in *both* fields (!)
2) The date in Cre date is now correctly shown as Oct 11th
3) The time in Cre date is not correctly displayed

So now everything is displayed properly.

But it gets more weird.

When I now submit the form without changing any values the day for the dob 
field gets decreased by one, e.g.:
displayed: Oct 10
<submit>
displayed: Oct 9
<submit>
displayed: Oct 8



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to