symfony sfValidatorSchemaCompare and dateformat output problem
        Posted  
        
            by Gerbrand
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Gerbrand
        
        
        
        Published on 2010-03-29T17:35:07Z
        Indexed on 
            2010/03/31
            11:43 UTC
        
        
        Read the original article
        Hit count: 369
        
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%")')))));
  }
I've got following input dates which I want to check if the end date isn't before the start date:
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.
Tried several things, but no luck at this moment. Didn't find a solution or information on symfony it self.
I'm using symfony version 1.2.11
© Stack Overflow or respective owner