public function configure()
{
$this->widgetSchema['start_date'] = new sfWidgetFormInput();
$this->widgetSchema['end_date'] = new sfWidgetFormInput();
$this->validatorSchema->setPostValidator( new sfValidatorOr ( array(
new sfValidatorAnd( array
(new sfValidatorSchemaCompare('start_date', sfValidatorSchemaCompare::NOT_EQUAL, null),
new sfValidatorSchemaCompare('end_date', sfValidatorSchemaCompare::EQUAL, null)
)),
new sfValidatorSchemaCompare('start_date', sfValidatorSchemaCompare::LESS_THAN_EQUAL, 'end_date',
array('throw_global_error' => false), array('invalid' => 'The start date ("%left_field%") must be before the end date ("%right_field%")')))));
}
Ben bitiş tarihi başlangıç tarihinden önce olup olmadığını kontrol etmek istiyorsanız aşağıdaki giriş tarihleri var:
Input: Start => 31/03/10 End=> 07/03/10 Output: The start date (2010-03-31) must be before the end date (2010-03-07)
Can you in some way change the date output? I need the error message to set the date format the same as the input. Also my input fields are set with the wrong date format when the error appears.
Şu anda bazı şeyleri, ama hayır şans denedi. Symfony o kendini bir çözüm ya da bir bilgi bulamadık.
Ben symfony sürüm 1.2.11 kullanıyorum