title: Symfony form validation for date fields (sfWidgetFormI18nDate)
body: <p>I am using Symfony 1.2.9, and I have a form that contains two date fields:</p>
  
  <p>start_date AND end_date.</p>
  
  <p>I want to impose the following validation criteria for the 'start_date' field:</p>
  
  <ol>
  <li>i). CANNOT be less than todays date
  ii). CANNOT be greater than end_date
  iii). CANNOT be more than 1 month
  away</li>
  </ol>
  
  <p>For end_date, I want the following restrictions:</p>
  
  <ol start="2">
  <li>i). Cannot be more than 3 months
  away from today</li>
  </ol>
  
  <p>I have written a post validator check as follows:</p>
  
  <pre><code>$today = date('Y-m-d');
  
  //post validator check to make sure end date &gt; start date
  $this-&gt;validatorSchema-&gt;setPostValidator(
   new sfValidatorAnd(array(
      new sfValidatorSchemaCompare('start_date', '&lt;', 'end_date',
        array('throw_global_error' =&gt; true),
        array('invalid' =&gt; 'The start date ("%left_field%") must be before the end date ("%right_field%")&lt;br /&gt;')
         ),
  
      new sfValidatorSchemaCompare('start_date', '&lt;', $today,
        array('throw_global_error' =&gt; true),
        array('invalid' =&gt; 'The start date ("%left_field%") cannot be earlier than today\'s date: ('.$today.')&lt;br /&gt;')
         ),
  
      new sfValidatorSchemaCompare('end_date', '&gt;', $today,
        array('throw_global_error' =&gt; true),
        array('invalid' =&gt; 'The end date ("%left_field%") cannot be before today\'s date ("%right_field%")&lt;br /&gt;')
         )
      )
     )
   );
  </code></pre>
  
  <p>However, this is not working - i.e. I have not found a way yet to enforce restrictions based on todays date, or offsets from today's date.</p>
  
  <p>A solution would be very welcome.</p>