To convert a date you can use sfDateFormat (instead of doing the
transformation in validator - inconsistent due to none association
between regex and date fields - Alex pointed it correctly).

something as:

$df = new sfDateFormat();
$retDate = $df->format($data_op_tted, $pattern = 'i', $inputPattern =
'dd/MM/yyyy', $charset = 'UTF-8');

$retDate should be in format 'yyyy-mm-dd'.

On Nov 27 2009, 4:47 pm, goofy <goofy.m...@gmail.com> wrote:
> Hi,
>
> after migration 1.2 to 1.3, ny sfvalidatordate dont work anymore and i
> cant find solution : I just want to type dd/mm/yy and get it in mysql
> format :
>
> new sfValidatorDate(array(
>         'date_format' => '/^(\d{2})\/(\d{2})\/(\d{2})/',
>         'date_output'=>'Y-m-d',
> 'with_time' => false, 'required' => true)),

-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.

Reply via email to